SQL interview Questions

SQL Interview Question [Hands Curated Top 50 Interview QUestions]

We live in a period where data is the most important resource and it’s being put on a fundamental level of each basic leadership process.

SQL powers the most commonly used database engines like MySQL, SQL Server, SQLite, and PostgreSQL:

Source: StackOverflow Developer Survey Results 2017

We all know that SQL is still making its come back to become the universal interface for data analysis once again.

Here we have listed down most frequently SQL interview questions. These questions cover experience ranging from the advance level to beginners level. Do believe us it is a SQL bible for those who want to prepare for their toughest interview.

Remember always try to put your best foot forward at all times during a job interview. If you have performed the role of DBA for a short stint and want to brush-up your fundamental concepts then these questions will be a great review. Check out SQL questions and SQL query here and drop in your answer suggestions or recent interview questions that made you caught off guard at MockRabbit Questions

Ques 1. When I delete data from a table, does SQL Server reduce the size of that table?

Ques 2. What is normalization?

Ques 3. What are the different properties of the relational tables available?

Ques 4. What will be the result of the query  listed below?

SELECT * FROM runners WHERE id NOT IN (SELECT winner_id FROM races)

Ques 5. Assume a schema of Col ( Id, Name, DeptId ) , Dept ( Id, Name)

Ques 6. Do you know all different normalization forms? Explain them.

Ques 7. What is a Trigger in SQL?

Ques 8. What are the different types of triggers?

Ques 9. What is a view?

Ques 10. What is an index?

Ques 11. What are Different Types of Joins?

Ques 12. Explain user-defined functions.

Ques 13. List and explain each of the ACID properties that collectively guarantee that database transactions are processed reliably.

Ques 14. How can you select all the even number records from a table? All the odd number records?  

Ques 15. What is the correct order of the Logical Query Processing  Phases? 

Ques 16. What is a PRIMARY KEY?

Ques 17. What is a FOREIGN KEY? 

 Ques 18. What is a UNIQUE KEY? 

Ques 19. What is a CHECK constraint?

 Ques 20. What is a NOT NULL constraint?

Ques 21. What is a DEFAULT definition? 

Ques. 22. What are catalog views?

Ques 23. What is the difference between the RANK() and DENSE_RANK() functions?

Ques 24. What are pessimistic and optimistic locks? 

Ques 25. What is the difference between the WHERE and HAVING clauses?

Ques 26. What is the difference between an update lock and exclusive lock?  

Ques 27. What is new in lock escalation in SQL Server 2008?

Ques 28. Given a table Employee having columns empName and empId, what will be the result of the SQL query below?

 select empName from Employee order by 2 desc;

Ques 29. What is the difference between the DELETE and TRUNCATE  commands?

Ques 30. What is the difference between single-row functions and multiple-row functions?

Ques31. What is collation?

Ques 32. What are different types of collation sensitivity?

Ques 33. Can we insert a row for identity column implicitly?

Ques 34. What is the difference between IN and EXISTS?

Ques 35. What is snapshot isolation?

Ques 36. What is the difference between Rename and Alias?

Ques 37. What is a B-tree?

Ques 38. What are the different index configurations a table can  have?

Ques 39. What is a filtered index?

Ques 40. What are indexed views inside SQL Server?

Ques 41. How do we use DISTINCT statement? What is its use?

Ques 42. What are DMVs and DMFs used for?

Ques 43. What are statistics inside SQL Server?

Ques 44. What is blocking?

Ques 45. What is a deadlock? How can you identify and resolve deadlock?

Ques 46. What is the maximum row size for a table?

Ques 47. Why & When should you use SPARSE COLUMN?

Ques 48. What are XML column-sets with SPARSE columns?

Ques 49. What is the maximum number of columns a table can have?

Ques 50. What are INCLUDED columns with SQL Server indices?