From: Lucía Moreno, marketing manager
Question: Should we run the SPRING20 coupon (20% off) again next spring?
"I need more than 'people used it'. Were coupon orders bigger or smaller than normal orders in March and April? Did coupon customers come back and buy again later? And what did the discount cost us?"
Data: orders (coupon_code, total, status), customers. Leave cancelled orders out. total is the order value before the coupon, so the discount is 20% of it.
Deliverable: the numbers for each question, then a recommendation the numbers support.
This case compares two groups, orders with the coupon and orders without, over the same period. Comparing within the same months matters: spring orders differ from winter ones, so a fair comparison holds the time window fixed and changes only one thing.
Each step answers one of Lucía's questions with one query. Name your columns as each step asks. The last step is the recommendation; the earlier numbers are your evidence, and you can run any query you like before you choose.