刘晨

【数据库】相关代码集

ε祈祈猫儿з 提交于 2020-01-21 15:04:57
1 Create Table student 2 ( 3 Sno char (9) Primary key , 4 Sname char (20) Unique , 5 Ssex char (2) , 6 Sage smallint , 7 Sdept char(20) 8 9 ); 10 11 Create Table Course 12 ( 13 Cno char (4) Primary key , 14 Cname char (40) not Null , 15 Cpno char (4) , 16 Ccredit smallint 17 foreign key (Cpno) References Course(Cno) 18 ); 19 20 Create Table SC 21 ( 22 Sno char (9) , 23 Cno char (4) , 24 Grade smallint 25 26 Primary key ( Sno , Cno ) , 27 Foreign key ( Sno ) References Student (Sno), 28 Foreign key ( Cno ) References Course (Cno) 29 30 ); 31 32 Insert Into student(Sno,Sname,Ssex,Sage,Sdept) 33