This commit is contained in:
Imbus 2024-01-25 21:05:45 +01:00
parent 228ff2efe2
commit f5d7fa8df5

10
o.sql Normal file
View 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;