# Join Example (Continue...)
__*Multi-table JOIN*__
+ The ratio of other planets in the Solar system to the Earth
```8
tidb> SELECT concat(p1.name, concat('/',p2.name)) as 'Others-Earth',
    -> p1.diameter/p2.diameter as Diameter,
    -> p1.mass/p2.mass as Mass,
    -> p1.gravity/p2.gravity as Gravity,
    -> p1.density/p2.density as Density,
    -> p1.escape_velocity/p2.escape_velocity as 'Escape Velocity'
    -> FROM ~!@stars s@!~
    -> JOIN ~!@planets p1@!~
    -> ON s.id = p1.sun_id AND s.name = 'Sun'
    -> JOIN ~!@planets p2@!~
    -> WHERE p1.name != 'Earth'
    -> AND p2.name = 'Earth';
+---------------+-----------+-----------------------+---------+---------+-----------------+
| Others-Earth  | Diameter  | Mass                  | Gravity | Density | Escape Velocity |
+---------------+-----------+-----------------------+---------+---------+-----------------+
| Pluto/Earth   |  0.186265 | 0.0021775545603165878 | 0.07143 |  0.3355 |         0.11607 |
| Neptune/Earth |  3.882722 |    17.085427736124856 | 1.12245 |  0.2971 |         2.09821 |
| Uranus/Earth  |  4.007369 |      14.5393645062375 | 0.88776 |  0.2303 |         1.90179 |
| Saturn/Earth  |  9.449357 |     95.14238190312665 | 0.91837 |  0.1246 |         3.16964 |
| Jupiter/Earth | 11.209156 |     317.9229592467155 | 2.35714 |  0.2405 |         5.31250 |
| Mars/Earth    |  0.532455 |   0.10753769549625292 | 0.37755 |  0.7135 |         0.44643 |
| Venus/Earth   |  0.948887 |    0.8157454031338826 | 0.90816 |  0.9492 |         0.92857 |
| Mercury/Earth |  0.382487 |  0.055276386048654806 | 0.37755 |  0.9846 |         0.38393 |
+---------------+-----------+-----------------------+---------+---------+-----------------+
8 rows in set (0.01 sec)
```

------------------------------------------------------------
Observe the execution plan and you will notice that it is very similar to the previous page.

```
tidb> EXPLAIN SELECT concat(p1.name, concat('/',p2.name)) as 'Others-Earth',
    -> p1.diameter/p2.diameter as Diameter,
    -> p1.mass/p2.mass as Mass,
    -> p1.gravity/p2.gravity as Gravity,
    -> p1.density/p2.density as Density,
    -> p1.escape_velocity/p2.escape_velocity as 'Escape Velocity'
    -> FROM stars s
    -> JOIN planets p1
    -> ON s.id = p1.sun_id AND s.name = 'Sun'
    -> JOIN planets p2
    -> WHERE p1.name != 'Earth'
    -> AND p2.name = 'Earth';
```
