SQL Interview Question
1. What are the different types of SQL joins and when would you use each one?
2. What is the difference between INNER JOIN and OUTER JOIN in SQL?
3. Explain the concept of normalization in database design and why it’s important.
4. What is a primary key and why is it used in a database?
5. Explain the difference between UNION and UNION ALL in SQL.
6. How do you create a new table in SQL? Provide an example.
7. What is a subquery in SQL and how can it be used in a query?
8. Explain the concept of indexing in databases and how it can improve query performance.
9. How do you retrieve the top N records from a table in SQL?
10. What are stored procedures and functions in SQL, and how do they differ?
11. Explain the difference between VARCHAR and CHAR data types in SQL.
12. How do you calculate the average, sum, minimum, and maximum values of a column in SQL?
13. What is a foreign key and how is it used in a database?
14. Explain the concept of ACID properties in the context of database transactions.
15. What is the purpose of the GROUP BY clause in SQL and how does it work?
16. How do you add, modify, and delete data in a table using SQL?
17. Explain the concept of NULL in SQL and how it’s handled in queries.
18. What is a view in SQL and why would you use it?
19. How do you retrieve data from multiple tables using JOINs in SQL?
20. Explain the difference between a clustered and a non-clustered index in SQL.
Get Bhaskar Berry’s stories in your inbox
Join Medium for free to get updates from this writer.
21. What are triggers in SQL and how do they work?
22. How do you handle duplicate records in a table using SQL?
23. Explain the difference between a candidate key, primary key, and super key in database design.
24. How do you concatenate strings in SQL?
25. What is the purpose of the HAVING clause in SQL and how does it differ from the WHERE clause?
26. Explain the concept of a self-join in SQL and when it might be used.
27. How do you perform data aggregation across multiple groups in SQL?
28. Explain the difference between a database and a schema in SQL.
29. How do you retrieve data from a table in a random order in SQL?
30. What is the purpose of the ORDER BY clause in SQL and how does it work?
31. What are window functions? Explain with examples.
32. How do you perform string manipulation and pattern matching in SQL?
33. Explain the difference between a left outer join and a right outer join in SQL.
34. What are the different types of subqueries in SQL and how are they used?
35. How do you find and remove duplicate records from a table in SQL?
36. Explain the concept of a materialized view in SQL and how it differs from a regular view.
37. How do you perform data validation and data cleansing in SQL?
38. Explain the difference between a transaction and a save point in SQL.
39. What is a schema in SQL and why is it used?
40. How do you calculate the difference between two dates in SQL?
41. Explain the concept of a composite key in database design and when it might be used.
42. What is a temporary table in SQL and how is it used?




