Scalar Subqueries Assessment 4

SELECT billing_country, ROUND(SUM(total), 2) AS country_total 
  FROM invoice 
 GROUP BY billing_country
HAVING country_total > (SELECT 10*AVG(total) 
                          FROM invoice)
 ORDER BY country_total DESC;

What I expected to happen:

Give me a table where only countries are listed that have a total sales which is 10 times higher then the average purchase total

What actually happened:


Which is the table that i expected.


I got feedback the table calculated is not correct and the code was not fixed correctly.

I’m at a loss. Someone any ideas?

There is no requirement for sorting in descending order.

You’re right about that, however the answer is still incorrect. :slight_smile:

I ran your code above but without the DESC and it passed.

It passed as in ‘your answer was submitted’ or…?

As it is still considered wrong at my side:

I believe the reason it is failing now is because you removed the ORDER BY clause entirely as opposed to just removing DESC as @the_doctor suggested above. Try your code again with ORDER BY country_total and let us know what happens.

You’re right, I was being a little too enthousiastic with deleting the whole line…


No worries, it happens to us all! Out of curiosity: Parlez-vous français?

Je ne parle pas Français, mais je peux faire semblant si j’utilise google translate. :wink:

pourquoi? :slight_smile:


Google translate is my friend too…I’m trying to learn Spanish. The reason I asked was your name looked like it could be French and the way you spelled enthusiastic reminded me of a French speaker. I learned to read/write in French before English as a kid so I tend to spell words like that too sometimes.

Ah, I get it. The dutch word for enthusiastic is enthousiast. :wink:
Problably a word we borrow from the French as there are many others.

1 Like