- Published on
SQL Problems 40
- Authors
- Name
- Lucian Oprea
- @LucianDSA_
00:30:00
Database Schema
⏷ Database Schema
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.
⏷ 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.