有三个表
Student
(学生名,姓名,年龄,地址)
Course
(课程名称,课程名称,信用)
Student_Course
(SCID,STUDID,COURSEID)
如何显示一个特定学生证所注册的总学分?
以下是有关tables
的详细信息答案 0 :(得分:1)
您应该使用JOIN,SUM()和分组依据
select a.STUDID, a.NAME, sum(b.CREDIT)
from Student a
inner join Student_Course c on a.STUDID = c.STUDID
inner join Course b on c.COURSEID = b.COURSEID
group by a.STUDID, a.NAME