I need to write a query that displays, for each activity, a count of the number of males and number of females.
Preferably in a 3 column format, activity_name, male (computed column), female (computed column).
I think I may need to use nested queries, but I cannot figure out how. Or could this be done by just using GROUP BY?
My tables are:
Child
child_id
child_fname
child_sname
child_gender
etc etc
Activity
activity_id
activity_name
etc etc
Child_Activity_Item
child_id
activity_id
Thank you
Try this query –