Instruction
Perfect! One more exercise before we move on.
Exercise
For each order, determine how many line items (unique products) were discounted and how many weren't. Show three columns:
- The order ID (
OrderID). - The number of line items that weren't discounted (as
FullPriceProductCount). - The number of line items that were discounted (as
DiscountProductCount)
Stuck? Here's a hint!
You can use the following to calculate the number of full-price products in each order:
COUNT(CASE
WHEN Discount = 0
THEN ProductID
END)




