O fixed
This commit is contained in:
parent
228ff2efe2
commit
f5d7fa8df5
1 changed files with 10 additions and 0 deletions
10
o.sql
Normal file
10
o.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
DROP VIEW IF EXISTS StudentsCredits;
|
||||
|
||||
CREATE VIEW StudentsCredits AS
|
||||
SELECT Students.pNbr, sum(credits) as totalCredits
|
||||
FROM Students
|
||||
JOIN TakenCourses ON Students.pNbr = TakenCourses.pNbr
|
||||
JOIN Courses ON TakenCourses.courseCode = Courses.courseCode
|
||||
GROUP BY Students.pNbr;
|
||||
|
||||
SELECT * FROM StudentsCredits ORDER BY totalCredits DESC;
|
Loading…
Reference in a new issue