1.创建表:

1 create table 表名(
2     列名  类型  是否可以为空,
3     列名  类型  是否可以为空
4 )ENGINE=InnoDB DEFAULT CHARSET=utf8
建表
1         默认值,创建列时可以指定默认值,当插入数据时如果未主动设置,则自动添加默认值
2             create table tb1(
3                 nid int not null defalut 2,
4                 num int not null
5             )
默认值

相关文章: