Find pairs with same salary in same department

Hard
4 views 23 Jan 2026
List employee pairs in the same department who have exactly the same salary (show both emp names)....

Basic inner join report

Easy
5 views 23 Jan 2026
List employee name with department name....

Left join to find missing match

Easy
2 views 23 Jan 2026
List all customers and their latest order_id if any. Customers without orders should still show....

Join three tables

Easy
2 views 23 Jan 2026
Show order_id, customer name, and total_amount....

Self join for manager relationship

Easy
2 views 23 Jan 2026
Employees(emp_id, name, manager_id). Show employee name and manager name....

Cross join for combinations

Easy
2 views 23 Jan 2026
Create all combinations of Sizes(s) and Colors(c) to generate SKU options....

Anti-join pattern

Medium
3 views 23 Jan 2026
Find products that never appear in OrderItems....

Join with date filter and aggregation

Medium
2 views 23 Jan 2026
For each customer, show total paid amount in the last 30 days. Join Orders with Payments and group by customer....

Full outer join style reconciliation

Medium
3 views 23 Jan 2026
You have table A_ids(id) and B_ids(id). Show ids that are missing on either side....

Many-to-many join with bridge table

Medium
2 views 23 Jan 2026
Students and Courses are many-to-many via Enrollment. Show student_name and course_name....

Join to pick latest row per group

Medium
2 views 23 Jan 2026
For each customer, show details of their latest order (not just id)....

Revenue by category with multi-join

Hard
2 views 23 Jan 2026
Orders, OrderItems, Products. Show category-wise revenue for shipped orders only....

Find customers who bought from every category

Hard
7 views 23 Jan 2026
Customers who have at least one purchase in each product category....

Detect overlapping shifts using self join

Hard
3 views 23 Jan 2026
Shifts(emp_id, start_time, end_time). Find employees whose shifts overlap on same day....

Top 2 products per city

Hard
3 views 23 Jan 2026
Customers(city), Orders, OrderItems. For each city, find top 2 products by quantity sold....