Advanced SQL Interview Questions With Examples
Advanced SQL Interview Questions With Examples
SELECT EXTRACT(MONTH FROM order_date) AS month, AVG(order_amount) FROM orders GROUP BY month;
30. Employees who made orders > 1000 and are in IT:
SELECT e.name, o.order_amount FROM employees e
JOIN orders o ON e.emp_id = o.emp_id
WHERE o.order_amount > 1000 AND e.department_id = 103;