Map of highways:
| Connections between cities |
MySQL tables that represent the picture above:
| MySQL tables |
Query
SELECT c1.name, highway_name, c2.name FROM c_conn c INNER JOIN c_cities c1 ON c.start_city_id = c1.id INNER JOIN c_cities c2 ON c.end_city_id = c2.id
and the result
| name | highway_name | city |
|---|---|---|
| albukerky | h23 | boston |
| boston | h24 | cornel |
| cornel | h25 | dallas |
No comments:
Post a Comment