I'm struggling to find a solution to this exercise. I really don't understand how to implement "the total number of lectures provided in October 2014" with " select the code of the classroom" within one query (I attach the photo and the database tables):
Unfortunately I cannot attach my pics directly, sorry for the links and other errors that I could have made. I attach also the code that I wrote, just for clarity, but I already know that it's wrong:
SELECT L0.RoomID,
COUNT(*),
MAX(AttendingStudent#)
FROM LECTURE L0
WHERE L0.RoomID IN(
SELECT L1.RoomID
FROM CLASSROOM C, LECTURE L1
WHERE C.RoomID = L1.RoomID
AND C.Video_Kit = 'yes'
AND L1.Date >= 01/01/2014
AND Date <= 31/12/2014
GROUP BY L1.RoomID
HAVING COUNT(DISTINCT L1.CCode) >= 20
)
AND Date >= 01/10/2014
AND Date <= 31/10/2014
GROUP BY L0.RoomID, L0.Date, L0.StartHour

