I'm working through a problem, working with SQL Oracle. I'm getting the right results beside a row that should be showing up that has a count of 0. The question is
Question:
For each section of the Project Management course, list the section ID, location and number of students enrolled. Sort by section ID.
My Code:
SELECT s.Section_Id, s.Location, COUNT(*) AS Enrolled
FROM Course c, Section s, Enrollment e
WHERE c.Course_No = s.Course_No
AND s.Section_Id = e.Section_Id
AND c.Description = 'Project Management'
GROUP BY c.Course_No, s.Location, s.Section_Id
ORDER BY s.Section_Id;
My Results:
SECTION_ID LOCATION ENROLLED
---------- ------------------- ----------
48 L211 4
119 L211 3
120 L214 2
Expected Results:
SECTION_ID LOCATION ENROLLED
---------- ------------------- ----------
48 L211 4
119 L211 3
120 L214 2
121 L507 0
So as you can see I'm missing the row with 0 enrolled on my results and can't seem to get that row to appear. Also you will notice that it is a section id and location that go with it for that project management class but it won't appear. I'm not sure what I'm doing wrong.
Any help would be great, also here is the Schema.
DBMS: I'm using Oracle SQL Developer