资源描述:
《sql查询语句练习.docx》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CREATETABLESTUDENT(SNOVARCHAR2(30)NOTNULL,SNAMEVARCHAR2(40)NOTNULL,SSEXVARCHAR2(20)NOTNULL,SBIRTHDAYDATE,CLASSVARCHAR2(50));CREATETABLECOURSE(CNOVARCHAR2(50)NOTNULL,CNAMEVARCHAR2(100)NOTNULL,TNOVARCHAR2(100)NOTNULL);CREATETABLESCORE(SNOVARCHAR2(30)NOTNULL,CNOVARCHAR2(50)NOTNULL,DEGREENU
2、MBER(10,1)NOTNULL);CREATETABLETEACHER(TNOVARCHAR2(30)NOTNULL,TNAMEVARCHAR2(40)NOTNULL,TSEXVARCHAR2(20)NOTNULL,TBIRTHDAYDATENOTNULL,PROFVARCHAR2(60),DEPARTVARCHAR2(100)NOTNULL);INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(108,'曾华','男',TO_DATE('1977-09-01','yyyy-mm-dd'),95033);
3、INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(105,'匡明','男',TO_DATE('1975-10-02','yyyy-mm-dd'),95031);INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(107,'王丽','女',TO_DATE('1976-01-23','yyyy-mm-dd'),95033);INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(101,'李军',
4、'男',TO_DATE('1976-02-20','yyyy-mm-dd'),95033);INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(109,'王芳','女',TO_DATE('1975-02-10','yyyy-mm-dd'),95031);INSERTINTOSTUDENT(SNO,SNAME,SSEX,SBIRTHDAY,CLASS)VALUES(103,'陆君','男',TO_DATE('1974-06-03','yyyy-mm-dd'),95031);INSERTINTOCOURSE(CN
5、O,CNAME,TNO)VALUES('3-105','计算机导论',825);INSERTINTOCOURSE(CNO,CNAME,TNO)VALUES('3-245','操作系统',804);INSERTINTOCOURSE(CNO,CNAME,TNO)VALUES('6-166','数据电路',856);INSERTINTOCOURSE(CNO,CNAME,TNO)VALUES('9-888','高等数学',100);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(103,'3-245',86);精选INSERTINTOSCORE(S
6、NO,CNO,DEGREE)VALUES(105,'3-245',75);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(109,'3-245',68);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(103,'3-105',92);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(105,'3-105',88);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(109,'3-105',76);INSERTINTOSCORE(SNO,CNO,DEGREE)VAL
7、UES(101,'3-105',64);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(107,'3-105',91);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(108,'3-105',78);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(101,'6-166',85);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(107,'6-106',79);INSERTINTOSCORE(SNO,CNO,DEGREE)VALUES(108,