学生成绩管理数据库建立-实验报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
学生成绩管理数据库建立-实验报告
课内实验报告
课程名:数据库系统概论
任课教师:
专业:
学号:
姓名:
二○至二○年度第学期南京邮电大学管理学院
教师表
课程表
成绩表
2.查询(使用SQL语句)
1.SELECT
FROM S
WHERE (((S.XB)="男"));
2.SELECT *
FROM S
WHERE SNO NOT IN (SELECT SNO
FROM S
WHERE CLASSNO='B131115');
3.SELECT CNAME, XF
FROM T, C
WHERE NAME="李峰" And T.TNO=C.TNO;
4.SELECT S.*
FROM S INNER JOIN G ON S.SNO=G.SNO WHERE O Like '3' And EXISTS(SELECT * FROM G AS G2
WHERE G.SNO=G2.SNO AND O Like '5' );
5.SELECT , S.SNO
FROM (S INNER JOIN G ON S.SNO=G.SNO) INNER JOIN C ON O=O
WHERE ((O)="7" Or (O="10")) GROUP BY , S.SNO;
6.SELECT , S.SNO
FROM S INNER JOIN G ON S.SNO=G.SNO WHERE (((O)="8"));
7.SELECT S.SNO, O, AME
FROM (S INNER JOIN G ON S.SNO=G.SNO) INNER JOIN C ON O=O
WHERE (((S.SNO) Like 'B13111502') AND
((Exists (SELECT * FROM G AS G2 WHERE O=O AND G2.SNO LIKE 'B13111604'))<>False));
8. SELECT *
FROM C
WHERE (((O) Not In (SELECT O FROM G)));
9.SELECT S.SNO, Avg(G.GRADE) AS GREAT 之平均值, Sum(G.GRADE) AS GREAT之总计FROM S INNER JOIN G ON S.SNO = G.SNO GROUP BY S.SNO;
10. SELECT , S.SNO, Count(G.GRADE) AS GRADE之计数
FROM S INNER JOIN G ON S.SNO = G.SNO WHERE (((G.GRADE)>90))
GROUP BY , S.SNO
11. SELECT S.SNO, , Sum(G.GRADE) AS GREAD之总计
FROM S INNER JOIN G ON S.SNO=G.SNO GROUP BY S.SNO,
HA VING Sum(G.GRADE)>200;
12. SELECT AME, O, Count(G.GRADE) AS GRADE之计数
FROM (S INNER JOIN G ON S.SNO=G.SNO) INNER JOIN C ON O=O
GROUP BY AME, O
13.
SELECT , Count(G.GRADE) AS GRADE之计数
FROM S INNER JOIN G ON S.SNO = G.SNO WHERE (((G.GRADE)<60))
GROUP BY
HA VING (((Count(G.GRADE))=4));
14. SELECT C.TNO, , Sum(C.XF) AS XF之总计
FROM C INNER JOIN T ON C.TNO=T.TNO GROUP BY C.TNO, ;
15. SELECT , T.TNO, Count(O)
AS CNO之计数
FROM T INNER JOIN C ON T.TNO=C.TNO GROUP BY , T.TNO
HA VING (((Count(O))>=3));
16. SELECT , T.TNO, Count(O) AS CNO之计数
FROM T INNER JOIN C ON T.TNO=C.TNO GROUP BY , T.TNO
HA VING (((Count(O))=1));
17. SELECT S.CLASSNO, O,
Max(G.GRADE) AS GRADE之最大值
FROM S INNER JOIN G ON S.SNO = G.SNO GROUP BY S.CLASSNO, O;
实验心得
通过本次学生成绩管理数据库的建立实验,我深入了解了有关关系数据库设计的基本思想方法。通过利用ACCESS软件创建数据库,首先建立正确完善的数据库表信息,包含学生、教师、课程和成绩表。然后使用SQL语言编写查询语句,并通过数据表视图显示结果,判断是否正确显示。在实验过程中出现了许多问题,有的问题是因为粗心导致的拼写错误、符号、字母缺漏错误,有的问题则是语法错误,一时很难找到解决的办法。后来通过翻阅课本、和同学讨论、查找资料、询问老师等方法顺利解决了问题。通过本次实验,我了解到了自己的不足之处,在今后的学习中要加以弥补,巩固强化。