LIMITED TIME OFFER: 50% OFF OF PREMIUM WITH OUR ANNUAL PLAN (THAT'S $294 IN SAVINGS).
GET OFFER

Simple Join SQL

Joins And Other Clauses Assessment | Dataquest

SELECT c.country, SUM(i.total) AS total
FROM invoice AS i
JOIN customer AS c
ON i.customer_id = c.customer_id
GROUP BY c.country;

What I expected to happen:
get a total of sales of each country

Replace this line with the output/error
Is incorrect because:

  • The set of columns used in the join conditions of the query is not correct. For example, column country from table customer was not used.

why? what do I do wrong?

thanks

1 Like

Nothing.

It’s a mistake on our part :scream: I just fixed it. Thank you for surfacing it!

1 Like