这道题应该如何来做?求前辈帮解答下。
时间:2011-12-01
来源:互联网
已知以下数据库:S表 Sid,Sname 为学生表 --- C表 Cid,Cname,Ctracher为课程表 --- SC表 Sid,Cid,Scgrade为选课关系及成绩表。其中,Sid为学号,Sname为姓名,Cid为课程号,Cname为课程名,Ctracher为任课教师,Scgrade为学生成绩。请用SQL语言实现:列出有二门以上(含两门)不几个课程的学生姓名及其平均成绩?
作者: iamlking 发布时间: 2011-12-01
又是作业题,留给楼下解决!
作者: luoyoumou 发布时间: 2011-12-01
示例数据
SQL code
查询:
SQL code
CREATE TABLE Student ( SID VARCHAR2(20), NAME VARCHAR2(20) ); INSERT INTO Student VALUES('001', '张三'); INSERT INTO Student VALUES('002', '李四'); INSERT INTO Student VALUES('003', '王五'); INSERT INTO Student VALUES('004', '菜六'); CREATE TABLE Course ( CID VARCHAR2(20), NAME VARCHAR2(20), CTeacher VARCHAR2(20) ); INSERT INTO Course VALUES('0001', '语文', '教师1'); INSERT INTO Course VALUES('0002', '数学', '教师2'); INSERT INTO Course VALUES('0003', '英文', '教师3'); INSERT INTO Course VALUES('0004', '物理', '教师4'); INSERT INTO Course VALUES('0005', '化学', '教师5'); INSERT INTO Course VALUES('0006', '政治', '教师6'); CREATE TABLE StudentCourse ( SID VARCHAR2(20), CID VARCHAR2(20), Grade NUMBER(4) ); INSERT INTO StudentCourse VALUES('001', '0001', 60); INSERT INTO StudentCourse VALUES('001', '0002', 70); INSERT INTO StudentCourse VALUES('001', '0003', 80); INSERT INTO StudentCourse VALUES('001', '0004', 90); INSERT INTO StudentCourse VALUES('001', '0005', 60); INSERT INTO StudentCourse VALUES('001', '0006', 70); INSERT INTO StudentCourse VALUES('002', '0001', 40); INSERT INTO StudentCourse VALUES('002', '0002', 50); INSERT INTO StudentCourse VALUES('002', '0003', 70); INSERT INTO StudentCourse VALUES('002', '0004', 80); INSERT INTO StudentCourse VALUES('002', '0005', 90); INSERT INTO StudentCourse VALUES('002', '0006', 70); INSERT INTO StudentCourse VALUES('003', '0001', 60); INSERT INTO StudentCourse VALUES('003', '0002', 50); INSERT INTO StudentCourse VALUES('003', '0003', 50); INSERT INTO StudentCourse VALUES('003', '0004', 60); INSERT INTO StudentCourse VALUES('003', '0005', 80); INSERT INTO StudentCourse VALUES('003', '0006', 90); INSERT INTO StudentCourse VALUES('004', '0001', 60); INSERT INTO StudentCourse VALUES('004', '0002', 70); INSERT INTO StudentCourse VALUES('004', '0003', 80); INSERT INTO StudentCourse VALUES('004', '0004', 90); INSERT INTO StudentCourse VALUES('004', '0005', 80); INSERT INTO StudentCourse VALUES('004', '0006', 90);
查询:

作者: LuiseRADL 发布时间: 2011-12-01
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28