资源描述:
《Oracle-SQL-练习题及答案.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、本文由NiCoBee贡献OracleSQL练习题注:这些查询题目涵盖了各种查询的技术,请大家认真做,做好了的查询语句之后,有兴趣的同学可以再创建相应的视图和存储过程createtablewkj_student(snovarchar2(10)primarykey,snamevarchar2(20),sagenumber(2),ssexvarchar2(5));createtablewkj_teacher(tnovarchar2(10)primarykey,tnamevarchar2(20));createtablewkj_course
2、(cnovarchar2(10),cnamevarchar2(20),tnovarchar2(20),constraintpk_courseprimarykey(cno,tno));createtablewkj_sc(snovarchar2(10),cnovarchar2(10),scorenumber(4,2),constraintpk_scprimarykey(sno,cno));/*******初始化学生表的数据******/insertintostudentvalues('s001','张三',23,'男');inserti
3、ntostudentvalues('s002','李四',23,'男');insertintostudentvalues('s003','吴鹏',25,'男');insertintostudentvalues('s004','琴沁',20,'女');insertintostudentvalues('s005','王丽',20,'女');insertintostudentvalues('s006','李波',21,'男');insertintostudentvalues('s007','刘玉',21,'男');insertintost
4、udentvalues('s008','萧蓉',21,'女');insertintostudentvalues('s009','陈萧晓',23,'女');insertintostudentvalues('s010','陈美',22,'女');commit;/******************初始化教师表***********************/insertintoteachervalues('t001','刘阳');insertintoteachervalues('t002','谌燕');insertintoteacherv
5、alues('t003','胡明星');commit;/***************初始化课程表****************************/insertintocoursevalues('c001','J2SE','t002');insertintocoursevalues('c002','JavaWeb','t002');insertintocoursevalues('c003','SSH','t001');insertintocoursevalues('c004','Oracle','t001');inserti
6、ntocoursevalues('c005','SQLSERVER2005','t003');insertintocoursevalues('c006','C#','t003');insertintocoursevalues('c007','JavaScript','t002');insertintocoursevalues('c008','DIV+CSS','t001');insertintocoursevalues('c009','PHP','t003');insertintocoursevalues('c010','EJB3.
7、0','t002');commit;/***************初始化成绩表***********************/insertintoscvalues('s001','c001',78.9);insertintoscvalues('s002','c001',80.9);insertintoscvalues('s003','c001',81.9);insertintoscvalues('s004','c001',60.9);insertintoscvalues('s001','c002',82.9);insertinto
8、scvalues('s002','c002',72.9);insertintoscvalues('s003','c002',81.9);insertintoscvalues('s001','c003','59');insertinto