A good SQL Server interview review connects fundamental relational principles to practical database development, administration, and troubleshooting.
Queries and relationships
What is a primary key? A key that uniquely identifies rows and does not allow NULL. What is a foreign key? A constraint that enforces a relationship to a candidate or primary key in another or the same table.
Joins and grouping
INNER JOIN returns matching rows; LEFT JOIN retains rows from the left table even without a match. GROUP BY aggregates related records; HAVING filters grouped results after aggregation.
Transactions and concurrency
What do COMMIT and ROLLBACK do? They complete or undo a transaction’s changes. Isolation levels affect what a transaction can observe and how concurrency behaves.
SQL Server-specific topics
Explain clustered and nonclustered indexes, execution plans, dynamic SQL with sp_executesql, Query Store, backups versus high availability, and the purpose of tempdb.
Practice exercise
SELECT CustomerID, COUNT(*) AS OrdersPlaced
FROM dbo.Orders
GROUP BY CustomerID
HAVING COUNT(*) >= 3;
Answering well
For each topic, supply a concise definition, one example, one trade-off, and a limitation. Confirm assumptions about schema, version, and workload before making performance claims.
AI disclosure and reuse: This AI-generated article is rewritten from an existing Open Education post (ID 67781). Additional explanations, code examples, and version notes may have been added. You may reuse the newly generated article text with or without attribution. Third-party trademarks and linked works retain their own rights. AI can make mistakes. Check examples, permissions, supported SQL Server versions, and documentation before use in any live system.
