Skip to content

Joining Data with SQL

Here you can access every table used in the course. To access each table, you will need to specify the world schema in your queries (e.g., world.countries for the countries table, and world.languages for the languages table).


Note: When using sample databases such as those that contain course data, you have read-only access. You can run queries, but cannot make any changes such as adding, deleting, or modifying the data (e.g., creating tables, views, etc.).

Take Notes

Add notes about the concepts you've learned and SQL cells with queries you want to keep.

Add your notes here

Spinner
DataFrameas
world_info
variable
-- Add your own queries here
SELECT *
FROM world.languages 
LIMIT 5

Cities of The World Arranged by country, reigion and continent

Spinner
DataFrameas
df
variable
select ci.name as city_, co.name as country_, co.region as region_, co.continent as continent_
from world.cities as ci 
join world.countries as co on ci.country_code = co.code
group by country_, city_, continent_, region_
order by country_;

**Languages in a Country **

Spinner
DataFrameas
df1
variable
select co.name as country_name, l.name as language_name
from world.countries as co join world.languages as l on co.code = l.code
group by country_name, language_name
order by country_name;

Languages by Countries

Spinner
DataFrameas
df2
variable
select  l.name as language_name, co.name as country_name
from world.countries as co join world.languages as l on co.code = l.code
group by co.name, l.name
order by language_name;