收藏 分享(赏)

《数据库原理》课件创建GradeManager数据库中表的SQL脚本.doc

上传人:bubibi 文档编号:23830190 上传时间:2024-09-07 格式:DOC 页数:2 大小:37.50KB
下载 相关 举报
《数据库原理》课件创建GradeManager数据库中表的SQL脚本.doc_第1页
第1页 / 共2页
《数据库原理》课件创建GradeManager数据库中表的SQL脚本.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

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:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报