ACTIVITY TABLE
( activity_id[Primary Key],
Activity)
CHILD TABLE
( child_id[Primary Key],
child_name,
child_gender,
child_dob)
CHILD ACTIVITY TABLE
( activity_id[Composite Primary Key],
child_id[Composite Primary Key]
Activity/Day Of Week)
答案 0 :(得分:3)
SELECT a.activity_id, a.Activity, c.child_gender, COUNT(*)
FROM ACTIVITY a
JOIN [CHILD ACTIVITY] ca ON a.activity_id = ca.activity_id
JOIN CHILD c ON ca.child_id = c.child_id
GROUP BY a.activity_id, a.Activity, c.child_gender