Write a SQL query to analyze NIKE retail sales by store, product, and week, including joins across sales, inventory, and store dimension tables.
Return all sales combinations associated with a known Nike store. Preserve sales rows without a matching inventory snapshot and classify inventory status based on available units.
store_id, store_name, region, product_id, week_start, total_units_sold, total_sales, ending_inventory_units, and inventory_status.store_id, week_start, and product_id.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique retail sale identifier |
| store_id | INT | Nike store that recorded the sale |
| product_id | VARCHAR(20) | Nike product identifier |
| sale_date | DATE | Date on which the sale occurred |
| units_sold | INT | Number of units sold |
| net_sales | DECIMAL(12,2) | Net sales amount in local reporting currency |
| Column | Type | Description |
|---|---|---|
| inventory_idPK | INT | Unique inventory snapshot identifier |
| store_id | INT | Store holding the inventory |
| product_id | VARCHAR(20) | Nike product identifier |
| week_start | DATE | Monday starting the inventory week |
| ending_units | INT | Units available at the end of the week |
| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique Nike store identifier |
| store_name | VARCHAR(100) | Nike store display name |
| region | VARCHAR(50) | Geographic sales region |