Free · In-browser · No signup

Practice SQL with
real company scenarios.

Click any question below, write SQL, run it live in your browser, and understand every concept in your language.

9 questions
⚠️ Note: These questions may or may not have been asked at the companies shown — the goal is to teach SQL through real-world usecases.
# Question Company Difficulty
1
For each customer, calculate the total number of orders and total order amount per month. Treat any NULL order_amount as 0. Return customer_id, order_month (in YYYY-MM format), total_orders, and total_amount, sorted by customer_id and then order_month.
GROUP BY · strftime · COALESCE
Amazon easy
2
Find suppliers whose average product unit price is greater than the average unit price of all suppliers in the same category. Return the supplier name, category, and average unit price. Sort the results by category and then by average unit price in descending order.
JOIN · GROUP BY · AVG
Flipkart mid
3
Find products whose total sales quantity is greater than the average total sales quantity of products from the same brand. Return the product name, brand and total sales quantity. Sort the result by brand and total sales quantity in descending order.
JOIN · GROUP BY · SUM
Myntra mid
4
For each TV show, calculate the completion percentage based on users who started Episode 1 versus users who watched the final episode. Round the result to 2 decimal places.
JOIN · WHERE IN · GROUP BY
Netflix mid
5
For each age group, calculate the percentage of time spent sending snaps vs opening snaps out of total send+open time. Round to 2 decimal places.
JOIN · WHERE IN · GROUP BY
Snapchat mid
6
For each employee, display their name, department, latest performance rating, the previous performance rating (to track improvement), their ranking within the department, and whether their latest rating is above or below their department's average. Sort by department and ranking.
Window Functions · ROW_NUMBER · RANK
Techcorp mid
7
For each user, count the total number of likes they have sent to others. Show user name along with the count, sorted by count in descending order.
JOIN · GROUP BY · COUNT
Tinder easy
8
Find total earnings of each driver and show top 3 earning drivers per city.
JOIN · GROUP BY · SUM
Uber mid
9
For each video, calculate the percentage of viewers who watched until the end out of all viewers who started the video. Round the result to 2 decimal places.
JOIN · WHERE · GROUP BY
Youtube mid