类型名称 |
说明 |
int(integer) |
整数类型 |
double |
小数类型 |
decimal(m,d) |
指定整数位与小数位长度的小数类型 |
date |
日期类型,格式为yyyy-MM-dd,包含年月日,不包含时分秒 |
datetime |
日期类型,格式为yyyy-MM-dd HH:mm:ss,包含年月日时分秒 |
timestamp |
日期类型,时间戳 |
varchar(M) |
文本类型,M为0~65535之间的整数 |
数据库设计中,一对多如何处理?
数据库外键关系表示的其实是一种一对多关系,所以处理一对多时可以使用外键。
5.数据库设计中,多对多一般如何处理?
引入中间表,把一个多对多表示为两个一对多。