100 MS SQL Server Interview Questions for Senior Developers π
Introduction
Microsoft SQL Server is one of the most widely used relational database management systems in enterprise applications. For senior developers, especially those working with .NET and backend systems, mastering SQL Server concepts is essential for building efficient, secure, and scalable applications. This blog organizes 100 commonly asked SQL Server interview questions into structured sections, making it easier to study and prepare.
1. SQL Basics
What is SQL?
Difference between SQL and T-SQL?
Types of SQL commands?
Difference between DELETE, TRUNCATE, and DROP?
What is NULL?
Difference between NULL and empty string?
What is identity column?
What is default constraint?
What is check constraint?
What is unique constraint?
2. Joins
What is JOIN?
Types of joins?
Difference between INNER JOIN and LEFT JOIN?
Difference between LEFT JOIN and RIGHT JOIN?
What is FULL OUTER JOIN?
What is SELF JOIN?
What is CROSS JOIN?
What is CROSS APPLY?
What is OUTER APPLY?
When to use APPLY?
3. Keys / Constraints
What is Primary Key?
What is Foreign Key?
What is Composite Key?
Candidate Key?
Alternate Key?
Super Key?
What is Index?
Clustered Index vs Non-Clustered Index?
Unique Index?
Filtered Index?
4. Stored Procedure / Functions
What is Stored Procedure?
Advantages of Stored Procedure?
What is Function?
Difference between Procedure and Function?
Scalar Function?
Table-Valued Function?
Inline TVF vs Multi-statement TVF?
Can SP return value?
Output parameter in SP?
Dynamic SQL?
5. Views
What is View?
Advantages of View?
Indexed View?
Materialized view?
Can we update a view?
Difference between View and Table?
What is schema binding?
6. Normalization
What is normalization?
1NF?
2NF?
3NF?
BCNF?
Denormalization?
When to denormalize?
7. Transactions
What is transaction?
ACID properties?
BEGIN / COMMIT / ROLLBACK?
Savepoint?
Nested transaction?
Distributed transaction?
8. Locks / Deadlocks
What is lock?
Types of locks?
Shared lock?
Exclusive lock?
Update lock?
What is blocking?
What is deadlock?
How to identify deadlock?
How to prevent deadlock?
What is NOLOCK?
9. Index / Performance
How index works?
Why query slow?
Execution plan?
Clustered index scan vs seek?
Non-clustered index seek?
Covering index?
Included column?
Fragmentation?
Rebuild vs Reorganize?
Statistics in SQL Server?
10. Advanced SQL
CTE?
Recursive CTE?
Temp table vs Table variable?
Difference between HAVING and WHERE?
ROW_NUMBER(), RANK(), DENSE_RANK()?
Partitioning?
Pivot and Unpivot?
MERGE statement?
XML/JSON in SQL?
Dynamic pivot?
11. Backup / Security / Real-world
Full backup vs Differential backup vs Log backup?
Recovery model?
Mirroring / Replication / Log shipping?
Always On Availability Group?
SQL Profiler?
How to optimize stored procedure?
Parameter sniffing?
How to troubleshoot production DB issue?
How to secure SQL Server?
What are common mistakes in DB design?
Conclusion
These 100 questions cover the breadth of SQL Server knowledge expected from senior developers. From basics and joins to advanced performance tuning, transactions, and real-world scenarios, this list serves as a comprehensive guide for interview preparation. By mastering these topics, you’ll not only be ready for interviews but also equipped to design and manage efficient, secure, and scalable database systems.
This was part of Interview Preparation With Bipin — Let’s Crack It!
Comments
Post a Comment