We need total credits of courses for each department.
So, we must use:
sum(credits)
Also, department and course must be joined using:
deptid = deptno
Then grouping must be done department-wise using:
group by deptid, name
Option (a) correctly uses join, sum and group by.
Option (b) uses count(credits), so it counts courses, not total credits.
Option (c) is syntactically incorrect.
Option (d) uses the join condition in having instead of where, so it is not the correct standard query.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.