I think you have the wrong picture before this text : “Our result set shows no ratios and all 0’s.”

Thank you for all the extremely useful content.

Cheers, Spyros

]]>SELECT DISTINCT Category,

COUNT(*) OVER (PARTITION BY Category)*100.0/ COUNT(*) OVER() as PctCategory

FROM CurrentProducts

Thanks,

Wayne (USA)

SELECT DISTINCT Category,

COUNT(*) OVER (PARTITION BY Category)*100.0/ COUNT(*) OVER() as PctCategory

FROM CurrentProducts

Wrong Answer 1 : your are meansed Percentage with decimals, this query division value integer and count result value also integer , so result should be integer

Wrong Answer 3: this query it will provide invalid result set as the numerator and denominator are interchanged.

Sivaguru.u

India

2.SELECT DISTINCT Category,

COUNT(*) OVER (PARTITION BY Category)*100.0/ COUNT(*) OVER() as PctCategory

FROM CurrentProducts

because

Option no 1–> displays categories with percentages in integer values.

Option no2 –> displays categories with percentages in decimal values.

Option no 3 –> displays incorrect results.

India

]]>Uday

USA

Clause – Day 11 of 35

A.) Because multiplying an aggregate by 100 (an integer) will result in the nearest integer (1) will not work. Since alculating a category’s percentage of the total products is done by dividing the quantity in the category by the quantity of all the products then multiplying by 100.0 (3) will be incorrect because it is dividing the total (COUNT(*) OVER ( )) by the category (COUNT(*) OVER(PARTITION BY Category)) instead. Because the category’s quantity is being multiplied by 100.0 (a decimal) before being divided by the quantity of all the products it will result in a decimal making (2) the correct answer.

Winner from USA: **Nagaraj Ejanthkar**

Winner from India: **P.Anish Shenoy**

I thank you all for participating here. The permanent record of this update is posted on facebook page.

]]>Will provide with decimals by utilizing the multiplier of 100.0 versus 100

Dan

New Jersey USA

The correct answer is #2.

Love this series.

Eric

USA