Return to exercises

Show how many families live in each place. Children are assumed to live with one of their parents and parents are assumed to live together if they share a child and are in the same city.

SQL:

Tables:

cities
idCity
2Eindhoven
1Tilburg
3Veldhoven
4Den Bosch

parentchild
ChildFatherMother
613
713
845

people
IdNameDOBCity
1Marcel0000-00-001
2Peter0000-00-002
3Gitte0000-00-001
4Leon0000-00-002
5Inge0000-00-003
6Sienna1990-01-011
7Thomas1992-01-011
8Bas1994-01-012