After some INNER JOIN I got a table like this:
SELECT ... FROM ... INNER JOIN ... ON ... GROUP BY ... id | no_of_places 01 | 2 02 | 0 03 | 10