10.16 (上午)开课一个月零十二天 (创建数据库,创建表)

1.创建数据库 create database test2;

2.删除数据库 drop database test2;

3.创建表 create table ceshi

**自增长 auto_increment

**主键 primary key

**外键 foreign key (列名)  references 主表名(列名)

**非空 not null

4.删除表 drop table ceshi;

注意: 1.类型包含长度的在类型后面加括号,括号里面写长度

2.上一列写完加逗号

3.最后一列不要写逗号

4.在每一条SQL语句写完之后要加分号

5.如果有外键关系,先创建主表

原文地址:https://www.cnblogs.com/l5580/p/5966224.html