|
| 1 | +# `African Cities` |
| 2 | + |
| 3 | +https://www.hackerrank.com/challenges/african-cities/problem?isFullScreen=true |
| 4 | + |
| 5 | +<br> |
| 6 | + |
| 7 | +>Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is 'Africa'. |
| 8 | +> |
| 9 | +>Note: CITY.CountryCode and COUNTRY.Code are matching key columns. |
| 10 | + |
| 11 | +<br> |
| 12 | + |
| 13 | +## `Input Format` |
| 14 | + |
| 15 | + The CITY and COUNTRY tables are described as follows: |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +<br> |
| 22 | + |
| 23 | +# `Solution` |
| 24 | + |
| 25 | +```sql |
| 26 | +select ct.name from city as ct inner join country as co on ct.CountryCode = co.Code where co.continent = 'Africa'; |
| 27 | +``` |
0 commit comments