Published:
Last updated:

SQL Problems

Authors
Time yourself:
Your progress:

00:30:00

0%

Database Schema

Database Schema

Filter by difficulty

11 of 11 questions shown

Select

1. Calculate the total quantity of products sold for each product_id

Junior
Flag important question
Mark as complete

2. Retrieve all orders placed in November 2023 using date filtering.

Junior
Flag important question
Mark as complete

3. Find all products with a price greater than the average price of all products.

Mid-level
Flag important question
Mark as complete

Joins and Relationships

4. Retrieve all products along with their category names using a join.

Mid-level
Flag important question
Mark as complete

5. Find the total revenue (price * quantity) for each product.

Mid-level
Flag important question
Mark as complete

Free preview complete

You’ve reached the end of the free preview

Get every remaining question and complete answer, plus progress tracking across the full Interview Question Library.

  • 6 more questions and complete answers in this topic
  • Full access to every interview topic
  • Progress tracking and question flags
  • New questions and improvements during your subscription

Full access from

$12/month

No long-term commitment. Cancel whenever you want.

6. For each category, calculate the total revenue generated by all products in that category.

Mid-levelPaid Question

7. List all categories with no products assigned.

Mid-levelPaid Question

8. List all products that have never been ordered (not present in the Orders table).

Mid-levelPaid Question

9. Retrieve the top 2 products with the highest total revenue using a limit or ranking function.

Mid-levelPaid Question

Advanced Select and Joins

10. Find the product with the highest total revenue, including its name and category.

Mid-levelPaid Question

SQL Functions

11. For each product, calculate the running total of quantities sold over time using window functions.

SeniorPaid Question