Introduction
Quick Refresher
6. PARTITION BY – Refresher 2
PARTITION BY ORDER BY with Ranking
PARTITION BY ORDER BY with Window Frames
Using PARTITION BY ORDER BY with Analytical Functions
Summary and Review

Instruction

That's right. One more exercise and we move on to PARTITION BY ORDER BY.

Exercise

For each sales row between August 1 and August 7, 2016, show the StoreId, Day, number of Transactions, the total number of transactions on that day in any store (TotalTransactions), and the ratio of the last two mentioned columns (as Ratio), shown as a percentage rounded to an integer.

Stuck? Here's a hint!

To avoid integer division, use CAST(Transactions AS NUMERIC). Remember to multiply the division result by 100 and then use ROUND(Value, Precision).