You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Here is SQL Code retriving: the top 10 countries for Rockbuster in terms of customer numbers
The query utilizes multiple joins because the "customer" and "country" tables are not directly linked.
To establish connections between tables, the query applies several joins: from the "customer" table ('A') to the "address" table ('B'), then from "address" to "city" ('C'), and finally from "city" to "country" ('D').
The outcome is then grouped by the "country" column.
SELECT D.country,
COUNT (A.customer_id) AS no_of_customers
FROM customer A
INNER JOIN address B ON A.address_id = B.address_id
INNER JOIN city C ON B.city_id = C.city_id
INNER JOIN country D ON C.country_id = D.country_id