Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Categories by Shipping Growth

Easy
EasySQL & Data ManipulationDate FunctionsGroup ByAggregations
Asked 2mo ago|
Whatnot
Whatnot
Asked 1 times

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

  1. Use only the shipments table.
  2. For each category, calculate total shipping cost in February 2024 and March 2024.
  3. Return only categories where March shipping cost is greater than February shipping cost.
  4. Output the category, February total, March total, and the growth amount (march_total - february_total).
  5. Sort by growth amount in descending order and return the top 3 categories.

Schema

shipments
ColumnTypeDescription
shipment_idPKINTUnique shipment record ID
categoryVARCHAR(50)Product category for the shipped item
shipped_dateDATEDate the shipment was sent
shipping_costDECIMAL(10,2)Shipping cost for the shipment
carrierVARCHAR(50)Carrier used for the shipment
Practicing as: Operations Manager interview at Whatnot

Hi, 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.

Take this as a live interview session →

You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.

Sign up freeI have an account
SELECT ...
FROM ...
JOIN ... ON ...
GROUP BY ...
HAVING ...
ORDER BY ... DESC;
Sign up to unlock solutions
Whatnot Operations Manager Interview QuestionsTop 50 Group By Interview Questions
Next questions
WayfairCalculate Monthly Sales Growth by Product CategoryMediumNestlé USASQL: Top SKUs for Late ShipmentsMediumZulilyAnalyze Monthly Revenue Trends by Product CategoryMedium