Problem
ShopSwift wants to identify which product categories are driving shipping cost increases. Write a SQL query to find the top categories contributing to shipping cost growth from February 2024 to March 2024.
Requirements
- Use only the
shipmentstable. - For each
category, calculate total shipping cost in February 2024 and March 2024. - Return only categories where March shipping cost is greater than February shipping cost.
- Output the category, February total, March total, and the growth amount (
march_total - february_total). - Sort by growth amount in descending order and return the top 3 categories.
Schema
shipments
| Column | Type | Description |
|---|---|---|
| shipment_idPK | INT | Unique shipment record ID |
| category | VARCHAR(50) | Product category for the shipped item |
| shipped_date | DATE | Date the shipment was sent |
| shipping_cost | DECIMAL(10,2) | Shipping cost for the shipment |
| carrier | VARCHAR(50) | Carrier used for the shipment |
Practicing as: Operations Manager interview at WhatnotHi, I'll play your Whatnot interviewer for the Operations Manager role. Candidates describe these interviews as mostly positive and moderately difficult, so expect me to be friendly and conversational. Take your time with the question above and answer like we're in the room.
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.



