1、-创建GradeManager数据库中表的SQL脚本-Create Table Student(Sno Char(7) Primary Key, Sname VarChar(20) Not Null, Ssex Char(2) Not Null, Sage Smallint, Clno Char(5) );Create Table Course(Cno Char(1) Primary Key, Cname VarChar(20) Not Null, Credit Smallint);Create Table Class(Clno Char(5) Primary Key, Speciality
2、VarChar(20) Not Null, Inyear Char(4) Not Null, Number Int, Monitor Char(7);Create Table Grade(Sno Char(7) Not Null, Cno Char(1) Not Null, Gmark Numeric(4,1), FOREIGN KEY(Sno)ReFERENCES Student(Sno), FOREIGN KEY(Cno)ReFERENCES Course(Cno),);INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2000101
3、,李勇,男,20,00311)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2000102,刘诗晨,女,19,00311)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2000103,王一鸣,男,20,00312)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2000104,张婷婷,女,21,00312)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2001
4、101,李勇敏,女,19,01311)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2001102,贾向东,男,22,01311)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2001103,陈宝玉,男,20,01311)INSERT INTO Student(Sno,Sname,Ssex,Sage,Clno) VALUES(2001104,张逸凡,男,21,01311)INSERT INTO Course(Cno,Cname,Credit) VALUES(1,数据库,4)I
5、NSERT INTO Course(Cno,Cname,Credit) VALUES(2,离散数学,3)INSERT INTO Course(Cno,Cname,Credit) VALUES(3,管理信息系统,2)INSERT INTO Course(Cno,Cname,Credit) VALUES(4,操作系统,4)INSERT INTO Course(Cno,Cname,Credit) VALUES(5,数据结构,4)INSERT INTO Course(Cno,Cname,Credit) VALUES(6,数据处理,2)INSERT INTO Course(Cno,Cname,Credi
6、t) VALUES(7,C语言,4)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000101,1,92)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000101,3,NULL)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000101,5,86)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000102,1,78)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000102,6,55)INSERT INTO Gra
7、de(Sno,Cno,Gmark) VALUES(2000103,3,65)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000103,6,78)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000104,1,54)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2000104,6,83)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001101,2,70)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001101,4,
8、65)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001102,2,80)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001102,4,90)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001102,6,83)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001103,4,76)INSERT INTO Grade(Sno,Cno,Gmark) VALUES(2001103,6,56)INSERT INTO class(clno,speciality,inyear,number,monitor) VALUES(00311,计算机软件,2000,120,2000101)INSERT INTO class(clno,speciality,inyear,number,monitor) VALUES(00312,计算机应用件,2000,140,2000103)INSERT INTO class(clno,speciality,inyear,number,monitor) VALUES(01311,计算机软件,2001,220,2001103)
侵权处理QQ:3464097650--上传资料QQ:3464097650
【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。