1    本节内容:

mysql 数据库建表(班级表和学生表)

 

Create table grade(gid varchar(32) primary key,

gname varchar(32) not null,

gdescribe varchar(300)

);

 

Create table Student(

sid varchar(32) primary key,

sname varchar(80) not null,

gid varchar(32),

sex char(2)

);

 

 

alter table student add  constraint  fk_student_gid foreign key(gid)

references grade(gid);

posted on 2018-01-15 00:09  菜鸟乙  阅读(147)  评论(0编辑  收藏  举报