use test2
create table student(
sno char(9) primary key,
sname char(20) not null,
Sex char(2) not null,
Sage int not null,
Sdept char(20)
)
create table Course(
Cno char(4) primary key ,
Cname char(40) not null,
Cpno char(40) ,
Ccredit Int not null
)
create table SC(
Sno char(9) foreign key references student(sno) not null,
Cno char(4) foreign key references Course(cno) not null,
Grade int
)
insert into Student
select '20215121','李勇','男',20,'CS' union
select '20215122','刘晨','男',19,'CS' union
select '20215123','王敏','女',18,'MA' union
select '20215125','张立','男',19,'IS'
insert into Course
select '1','数据库',NULL,4 union
select '2','数学',NULL,2 union
s