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.
Solution: https://github.com/dataquestio/solutions/blob/master/Mission191Solutions.ipynb

I cannot seem to figure out why the customer table is filtered by “where country = c.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!

2 Likes

hey @sunna.jo

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.

2 Likes

Thank you very much, this was helpful!

Hi @sunna.jo

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.