查看当前数据库中所有表show tables;
创建表
auto_increment表示自动增长
create table 表名(列及类型);
如:create table students(id int auto_increment primary key,sname varchar(10) not null);
create table 表名(键 类型 自增 主键 非空)
create table students(
id int auto_increment primary key not null, #主键形式一致
name varchar(10) not null,
birthiday datetime,
gender bit default 1,
isDelet bit default 0
);
修改表
alter table 表名 add|change|drop 列名 类型;
如:
alter table students add birthday datetime;
删除表
drop table 表名;
查看表结构
desc 表名;
更改表名称rename table 原表名 to 新表名;
查看表的创建语句show create table ‘表名‘;
————————————————
版权声明:本文为CSDN博主「lowson0810」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sqx3553465/article/details/79633009
原文:https://www.cnblogs.com/jk123456/p/11641589.html