Question re: Guided Project: Answering Business Questions using SQL - Mission 5 (Analyzing Sales by Country)

Would anyone be able to walk me through the solution for Mission 5 (Analyzing Sales by Country)? I am having trouble understanding it despite multiple attempts to work through it.

I cannot seem to figure out why the customer table is filtered by “where country =” in the CASE clause in the country_or_other table in the initial portion of the code, and I am having difficulty understanding the final query, particularly why we cannot use the sum of the total values in the invoice table to calculate the total sales.

Any help would be greatly appreciated, thank you!



you can check out the explanation as provided by @Bruno for this post: 280-5 Analyzing Sales by Country

you can also check out this wiki page for outer subquery being referenced by inner sub-query:

Let us know if this doesn’t help you.


Thank you very much, this was helpful!


I am also stuck with exactly same questions you posted here. I tried to go though the links provided by @Rucha, but still could not get the questions answered. I see that you were able to find the answers. If it is okay with you, could you please give me an explanation for these questions, esp for the below one.

Thanks and regards.