Basic SQL Questions
1. What is SQL?
2. What is the difference between SQL and MySQL?
3. What are the different types of SQL commands (DDL, DML, DCL, TCL)?
4. What is a primary key?
5. What is a foreign key?
6. What is a unique key?
7. What is a composite key?
8. What is a candidate key?
9. What is the difference between WHERE and HAVING?
10. What is the difference between DELETE, TRUNCATE, and DROP?
⭐ Intermediate SQL Questions
11. What is a join? Name different types of joins.
12. What is the difference between INNER JOIN and LEFT JOIN?
13. What is normalization? Explain 1NF, 2NF, 3NF.
14. What is denormalization?
15. What are SQL constraints?
16. What is an index? Why is it used?
17. What is a view?
18. What is a subquery?
19. Difference between correlated and non-correlated subqueries.
20. What is a stored procedure?
⭐ Advanced SQL Questions
21. What is a trigger?
22. What is a cursor?
23. Explain ACID properties.
24. What is a transaction?
25. What is deadlock? How can it be prevented?
26. What is query optimization?
27. What is the difference between OLAP and OLTP?
28. What is partitioning in SQL?
29. Difference between cluster and non-clustered index.
30. What are window functions? (ROW_NUMBER, RANK, etc.)
⭐ SQL Query Practice Questions
31. Write an SQL query to find the second highest salary.
32. Write a query to count employees department-wise.
33. Query to find duplicate records in a table.
34. Query to delete duplicate rows but keep one.
35. Query to fetch employees hired in the last 30 days.
36. Query to get the highest-paid employee in each department.
37. Query to get all records where a column contains a specific substring.
38. Query to get students who scored more than class average.
39. Query to update a salary by 10% for all employees.
40. Query to display total number of rows in a table.
⭐ SQL Theory + MCQ Style
41. What is the difference between IN and BETWEEN?
42. What does GROUP BY do?
43. What does COUNT(*) include?
44. Which is faster: COUNT(column) or COUNT(*)?
45. What is the default sorting order of ORDER BY?
46. What is referential integrity?
47. What is the difference between VARCHAR and CHAR?
48. What is a schema?
49. What is cross join?
50. How does the EXISTS keyword work?