查询所有同学成绩单,成绩以等第显示,包括sno,sname,cno,degree和rank列,rank列即等第
时间: 2024-03-19 07:40:48 浏览: 82
好的,我会尽力回答。根据你的要求,我假设你的数据库中有以下表结构:
- 学生表(student)包含以下列:sno(学号),sname(姓名)
- 课程表(course)包含以下列:cno(课程号)
- 成绩表(score)包含以下列:sno(学号),cno(课程号),degree(成绩)
等第的规则我也需要你告诉我,例如90分以上为A,80-89分为B,以此类推。如果你不确定,我可以提供一些常见的等第规则供你选择。
相关问题
写出SQL语句,查询所有学生的成绩单,包括Sno、Sname、Cno、Cname和Degree列
好的,以下是SQL语句:
SELECT Score.Sno, Student.Sname, Score.Cno, Course.Cname, Score.Degree
FROM Score, Student, Course
WHERE Score.Sno = Student.Sno AND Score.Cno = Course.Cno;
(1)、 写出SQL语句,查询所有学生的成绩单,包括Sno、Sname、Cno、Cname和Degree列,将运行无误后的SQL语句写入答题文件夹中的MYSQL1.TXT保存。
可以使用如下SQL语句查询所有学生的成绩单:
SELECT
sc.Sno,
s.Sname,
sc.Cno,
c.Cname,
sc.Degree
FROM
SC AS sc
JOIN Student AS s ON sc.Sno = s.Sno
JOIN Course AS c ON sc.Cno = c.Cno;
请将此SQL语句保存至MYSQL1.TXT文件中。
阅读全文
相关推荐















