Your question is Year-over-Year Product Growth. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Stryker's commercial analytics team wants to monitor annual sales performance for the Mako product line. Write a PostgreSQL query that calculates year-over-year sales growth from the available sales records.
sales to products and include only products where product_line = 'Mako'.sale_date and sales_amount.NULL for the first year when no prior-year sales exist.| Column | Type | Description |
|---|---|---|
| product_idPK | INTEGER | Unique product identifier |
| product_name | VARCHAR(100) | Name of the Stryker product |
| product_line | VARCHAR(50) | Stryker product line associated with the product |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique sale identifier |
| product_id | INTEGER | Product associated with the sale |
| sale_date | DATE | Date on which the sale was recorded |
| sales_amount | NUMERIC(12,2) | Sales value for the transaction |