I have a problem in which I need to be able to count the number of activities a child has registered to do. At the moment I have this:
SELECT child_fname, activity_id
FROM Child
LEFT JOIN Activity
ON Activity.ActivityID=activity.activity_id
ORDER BY Child.child_fname;
and my tables are like this:
Child Table
- child_firstname
- child_secondname
- child_age
Activity
- activity_id
- activity_name
- activity_price
ChildActivity
- child_id
- activity_id
I'm looking for something like this
- [Name][Number of Activities]
- Sam Smith 5
- Rachel Smith 4
I tried using an JOIN but my query doesn't update for new data