What SQL questions does Amazon ask?
Amazon's SQL questions are grounded in e-commerce and logistics data — orders, customers, products, and delivery performance. These are the most commonly reported patterns:
Customer Lifetime Value
Calculate total spend, average order value, and order count per customer. Segment into Bronze, Silver, and Gold tiers by spend.
Uses: SUM() AVG() CASE WHEN COUNT()
Top 3 Products per Category
For each category, find the top 3 best-selling products by revenue in the last 90 days. Include all tied products.
Uses: DENSE_RANK() PARTITION BY date filter
Delivery Performance
Calculate on-time delivery rate per warehouse and carrier. Find the worst-performing combinations.
Uses: CASE WHEN AVG() multi-column GROUP BY
Repeat Customers
Find customers who placed at least 2 orders in the same month. Return customer, month, and total orders.
Uses: DATE_TRUNC HAVING COUNT GROUP BY
First Purchase Category
For each customer, identify the category of their very first purchase. Calculate what % of customers started with each category.
Uses: FIRST_VALUE() ROW_NUMBER() percentage calc
Unshipped Orders
Find all orders that have not been shipped yet and are more than 3 days old.
Uses: LEFT JOIN IS NULL DATEDIFF