C2w1-Lab 1: Interacting With a Relational Database Using SQL. Exercise 10

Hi data engineers.
Can someone help me with Exercise 10? I don’t understand to much what should I do here.

Exercise: Write an SQL query to obtain the country, city, and address of the active staff members.
I’m trying this:

SELECT country.country, city.city, address.address
FROM staff
JOIN city ON country.country_id = city.country_id
JOIN address ON city.city_id = address.city_id
JOIN none ON none.none= none.none (I don’t know how to continue here)
WHERE staff.active;

Expected outcome

Thanks in advance.

Hello @LuiferG_AI
it seems you are not using the country table. You could use FROM the staff table, also change your query to JOIN the three tables (address, city, country) ON the respective key (e.g. JOIN country ON country.country_id=city.country_id etc)

1 Like