I am planning to do a query where it will will summarize total number of students registered for each subjects, number of student registered for lecture session and also number of student registered for each tutorial session. I developed a query but it is not giving the output as I expected. Can anyone solve the problem?
select s.subject_id, s.subject_name, count(stud_id), count(r.session LIKE 'LEC'), count(r.session LIKE 'TUT')
from subject as s, registration as r
where (r.subject_id = s.subject_id) AND (r.session = s.session)
group by r.subject_id, r.session ;