Write a SQL query to analyze retail performance by joining sales, inventory, and promotion tables, and calculate availability, sell-through, and promotion lift by region.
Use the supplied tables and data. Treat missing sales as zero, and include inventory records even when no sale or promotion matches.
Output
- One row per region with
region, availability_pct, sell_through_pct, promotion_lift_pct, and promotion_lift_rank.
- Availability is the percentage of inventory records with positive ending stock. Sell-through is sold units divided by sold units plus ending stock. Promotion lift compares average units sold on promotion with average units sold without promotion.
- Round percentage metrics to two decimal places. Order by
promotion_lift_rank, then region.