BLACK FRIDAY EXTRA SAVINGS EVENT - EXTENDED # #254-6 The "correct" answer is not what the question asks for

My Code:

``````select Major_category, sum(Women) as Total_women,
avg(ShareWomen) as Mean_women,
sum(Total) * avg(ShareWomen) as Estimate_women
group by Major_category
``````

What I expected to happen:
I expected this to be the wrong answer. This is what passed the problem. The rubric clearly states that it needs a percentage not a fraction. I expected that multiplying the fraction by 100 to express it as a percentage to be the correct answer. It took quite some time to track this down and it was just frustrating when I started playing with the answer and it worked.

What actually happened:

``````Replace this line with the output/error
``````
4 Likes

Hello, @cogsci2 and welcome to the community!

Here’s the instruction:

1. Write a query that, for each major category, displays in order:
• The major category
• The total amount of women with the alias `Total_women`
• The average percentage of women with the alias `Mean_women`
• The result of multiplying the total number of graduates by the average percentage of women with the alias `Estimate_women` .

Please note that it doesn’t say anything about percentage or fraction. It just asks for the result of multiplying the total number of graduates by the average percentage of women.

2 Likes

Hello!
Thank you for asnwering the question. However, the third point does ask for percentage

3 Likes

Hello!

That’s actually my bad. I misunderstood the question and thought we were talking about the last item only.

You and @cogsci2 are right. In order to be the percentage it should me multiplied by 100. I suppose the correct answer should look like this:

``````SELECT Major_category,
SUM(Women) AS Total_women,
AVG(ShareWomen * 100) AS Mean_women,
SUM(Total)*AVG(ShareWomen) AS Estimate_women
GROUP BY Major_category;
``````

Could you look into it @Sahil? It’s a simple mistake but it can lead to confusion.

Thank you @pudgiko and @cogsci2 for pointing it out.

4 Likes

Yes, it can be confusing. Thank you for letting us know; I will get it logged for correction.

Best,
Sahil

5 Likes

This issue has been fixed. 3 Likes