This is really complicated, then I will say an example in order to make it easier.

Imagine that we have 4 tables: garages, cars, securities, places.

`garages` is where you can find the `cars`, `securities` is the security that is keeping that car safe inside of a garage, and `places` is where you can find garages similar to that one. Then we have a table like that.

garages table:

```
-----------------------------------
|garage_id|garage_name|garage_size|
-----------------------------------
|        1|   Garage 1|        200|
-----------------------------------
|        2|   Garage 2|        400|
-----------------------------------

```

cars table:

```
---------------------------
|car_id|car_name|garage_id|
---------------------------
|     1|   Car 1|        1|
---------------------------
|     2|   Car 2|        1|
---------------------------
|     3|   Car 3|        2|
---------------------------

```

securities table:

```
----------------------------------
|security_id|security_name|car_id|
----------------------------------
|          1|  Security 1|      1|
----------------------------------
|          2|  Security 2|      1|
----------------------------------
|          3|  Security 3|      2|
----------------------------------
|          4|  Security 4|      3|
----------------------------------

```

places table:

```
-------------------------------
|place_id|place_name|garage_id|
-------------------------------
|       1|   place 1|        1|
-------------------------------
|       2|   place 2|        1|
-------------------------------
|       3|   place 3|        1|
-------------------------------
|       4|   place 4|        2|
-------------------------------
|       5|   place 5|        2|
-------------------------------

```

What I want is to list the garages and join the three tables that is cars, securities and places like this:

> 
> Garage 1 has 2 cars with 3 securities and has 3 more garages similar
> 
> 
> Garage 2 has 1 cars with 1 securities and has 2 more garages similar
> 
> 
> 

Now you might ask, why `Garage 1` has 3 securities? Because the `Garage 1` has `Car 1` and `Car 2` and `Car 1` has two securities `Security 1` and `Security 2` and `Car 2` has 1 that is `Security 3`.

The problem here is: How to join the tables and count in one single query and return the result just like you can see above?