然后创建选课表SC,学号和课号联合作主键,分别作外键。
create table sc(学号 char(6),课号 char(6),成绩 int,primary key (学号,课号),foreign key (学号)references 学生(学号),foreign key (课号)references 课程(课号))
create table student(
id int Not Null,
studentnumber varchar(22),
name id int Not Null,
`````
)
craete table course
(
`````
)
craete table sc
(
``````
)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)