- Published:
- Last updated:
SQL Problems
- Authors
- Name
- Lucian Oprea
- @LucianDSA_
00:30:00
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
⏷ 2. Retrieve all orders placed in November 2023 using date filtering.
⏷ 3. Find all products with a price greater than the average price of all products.
Joins and Relationships
⏷ 4. Retrieve all products along with their category names using a join.
⏷ 5. Find the total revenue (price * quantity) for each product.
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.
⏷ 7. List all categories with no products assigned.
⏷ 8. List all products that have never been ordered (not present in the Orders table).
⏷ 9. Retrieve the top 2 products with the highest total revenue using a limit or ranking function.
Advanced Select and Joins
⏷ 10. Find the product with the highest total revenue, including its name and category.
SQL Functions
⏷ 11. For each product, calculate the running total of quantities sold over time using window functions.