Question: Find all orders placed in the last 30 days.Answer: SELECT * FROM Orders WHERE OrderDate >= DATE_SUB(CURDATE(), INTERVAL 30 DAY); Advanced SQL Practice Questions
Question: Write a query to find employees who earn more than the average salary of the entire company.Answer: SELECT Name, Salary FROM Employees WHERE Salary > (SELECT AVG(Salary) FROM Employees); sql query questions and answers for practice pdf download
Question: How do you find all employees who work in the 'Sales' department?Answer: SELECT * FROM Employees WHERE Department = 'Sales'; Question: Find all orders placed in the last 30 days
Question: Show the unique job titles available in the Company table.Answer: SELECT DISTINCT JobTitle FROM Company; INTERVAL 30 DAY)