SQL Server Questions
SQL Server relational database management system (RDBMS); covers installation and configuration, T-SQL programming, indexing and query optimization, data modeling, data types, transaction handling, backup and recovery, replication, high availability (Always On), security, maintenance, and administration tasks specific to SQL Server.
MediumTechnical
79 practiced
You manage a 500GB OLTP table that shows average fragmentation > 30%. Describe how you would decide between REORGANIZE and REBUILD, including thresholds, online/offline options, impact on locks, and how fillfactor should be considered. Provide a maintenance approach that minimizes user impact.
EasyTechnical
73 practiced
Explain the difference between a PRIMARY KEY and a UNIQUE constraint in SQL Server. Can a UNIQUE constraint allow NULL values? Describe how NULLs are treated with unique constraints and practical implications for data modeling.
HardTechnical
81 practiced
A stored procedure performs poorly for some input parameters but is fast for others. Explain parameter sniffing, how to diagnose it using cached plan information and DMVs, and enumerate strategies to mitigate it (e.g., OPTION(RECOMPILE), OPTIMIZE FOR, local variable tricks, plan guides). Discuss the trade-offs of each approach.
MediumTechnical
60 practiced
Write a T-SQL script that removes duplicate rows from a table called 'orders' where duplicates are defined by the combination (customer_id, order_date). Keep the row with the highest order_id and delete other duplicates in a way that minimizes transaction log and blocking.
MediumTechnical
86 practiced
You need to implement a sliding window purge for a very large partitioned table: new data is arriving daily and older data (> 90 days) must be removed with minimal blocking. Describe the steps in SQL Server to partition the table by date, load new data, and remove old partitions using partition switching. Include index and constraint considerations.
Unlock Full Question Bank
Get access to hundreds of SQL Server interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.