3 views
23 Jan 2026
Find employees whose salary is above the company average salary....
2 views
23 Jan 2026
List customers who have placed at least one order....
2 views
23 Jan 2026
Find products that have at least one order item....
2 views
23 Jan 2026
Get department-wise average salary, then list departments where avg salary > 50000....
2 views
23 Jan 2026
List employees who earn more than the average salary of their own department....
4 views
23 Jan 2026
Return orders that are the latest order for each customer....
3 views
23 Jan 2026
Return the second highest distinct salary from Employees....
3 views
23 Jan 2026
Write a query using subquery that returns customers who placed more than 3 orders....
3 views
23 Jan 2026
Find customers who did not place any order. Use NOT EXISTS (safer than NOT IN)....
3 views
23 Jan 2026
Update Employees set salary to department average salary for employees who have salary NULL....
8 views
23 Jan 2026
Return products where price is greater than average price of their category....
3 views
23 Jan 2026
Payments(order_id, due_date, paid_at). Find customers where for every payment, paid_at > due_date....
2 views
23 Jan 2026
Delete Products that were created more than 365 days ago and never appeared in OrderItems. Use NOT EXISTS to avoid NULL issues....
2 views
23 Jan 2026
Find the product category with the highest revenue. Revenue = SUM(qty * price) from OrderItems joined with Products....
2 views
23 Jan 2026
Return customers for which there is no order with unpaid balance. Unpaid means Orders.total_amount > sum(Payments.amount)....