day 34小结
目录 1.操作表 操作表数据行 1.操作表 增: create table 表名( 字段名 列类型 [可选的参数], 字段名 列类型 [可选的参数], 字段名 列类型 [可选的参数] )charset = utf8; 例子1: create table t1( id int , name char(5) )charset = utf8; Query OK, 0 rows affected (0.41 sec) # 表示创建成功 增加数据语法: 语法: insert into 表名 (列1,列2) values (值1,'值2'); 例子: insert into t1 (id,name) values (1,'zekai'); 例子2: create table t1( id int auto_increment primary key, name char(5) not null default 'xxx', age int not null default 0 )charset = utf8; 表的约束: auto_increment : 自增 1 primary key : 主键索引,加快查询速度 not null : 标识该字段不能为空 default : 为该字段设置默认值 列类型: 数字 整型 tinyint smallint int mediumint