Top SQL Interview Questions

 Q1: Define a Temp Table

Q2: What is a VIEW?

Q3: What is PRIMARY KEY?

Q4: What is Normalization? Related To: Databases

Q5: What is DEFAULT?

Q6: What is FOREIGN KEY?

Q7: What is the difference between TRUNCATE and DELETE? Related To: MySQL

Q8: What is the difference between Data Definition Language (DDL) and Data Manipulation Language (DML)? Related To: MySQL, T-SQL, Databases

Q9: Define ACID Properties Related To: Databases

Q10: Discuss INNER JOIN ON VS WHERE clause (with multiple FROM tables)

Q11: What is the difference between INNER JOIN and OUTER JOIN?

Q12: What is the difference between JOIN and UNION?

Q13: What is the difference between UNION and UNION ALL?

Q14: What is the difference between WHERE clause and HAVING clause?

Q15: What is the difference between INNER JOIN, OUTER JOIN, FULL OUTER JOIN?

Q16: Describe the difference between truncate and delete?

Q17: What is Denormalization? Related To: Databases

Q18: What is the difference between Clustered and a Non-clustered index? Related To: Databases

Q19: How does a Hash index work?

Q20: How can a database index help performance? Related To: Databases

Q21: What's the difference between a Primary Key and a Unique Key? Related To: Databases

Q22: What is Collation?

Q23: How can VIEW be used to provide security layer for your app? Related To: MySQL

Q24: What's the difference between Azure SQL Database and Azure SQL Managed Instance? Related To: Azure, T-SQL

Q25: What is the cost of having a database index? Related To: Databases

Q26: How does B-trees Index work? Related To: Databases

Q27: Explain the difference between Exclusive Lock and Update Lock Related To: Databases

Q28: What is the difference among UNION, MINUS and INTERSECT?

Q29: What is faster, one big query or many small queries? Related To: MySQL

Q30: What is Optimistic Locking and Pessimistic Locking? Related To: Databases

Q31: How does database Indexing work? Related To: Databases

Q32: What are some other types of Indexes (vs B-Trees)? Related To: Databases

Q33: Name some disadvantages of a Hash index Related To: Databases

Q34: What is the difference between B-Tree, R-Tree and Hash indexing? Related To: Databases

Q35: What is Index Cardinality and why does it matter? Related To: Databases, MongoDB


Code Challenges

Q1: Find duplicate values in a SQL table Related To: MySQL

Q2: How to select first 5 records from a table?

Q3: How can I do an UPDATE statement with JOIN in SQL?

Q4: How does TRUNCATE and DELETE operations effect Identity? Related To: T-SQL

Q5: How to generate row number in SQL without ROWNUM

Q6: How can we transpose a table using SQL (changing rows to column or vice-versa)?

Q7: What would happen without an Index?

Q8: Delete duplicate values in a SQL table?

Q9: Select first row in each GROUP BY group (greatest-n-per-group problem)?

Comments

Popular posts from this blog

Cursor

SQL Queries

Index