Skip to content

SQL Server Interview Questions and Answers Course

Walk into your next SQL Server interview ready for any question

A self-paced video course from Steve Stedman that works through the questions DBAs and developers actually get asked, with the answers and the reasoning behind them. 43 lessons, 2.5+ hours of video, lifetime access, one payment of $39.99.

Watch the first two lessons free before you buy.

Hiring a DBA or developer and want help screening candidates? Book a free 30-minute consultation.

SQL Server Interview Questions and Answers course from Stedman Solutions
43lessons in 5 sections
2 h 41 mof video, plus a knowledge check
Lifetimeaccess that never expires
$39.99one-time, installments available

Built for both sides of the interview table

Job candidate on a video call reviewing notes during a remote SQL Server interview

Preparing for a DBA or developer interview

  • Hear the questions hiring managers actually ask, from upgrades and recovery models to log shipping, SQL Agent jobs and TempDB
  • Get the reasoning behind every answer so you can handle the follow-up question too
  • Cover the performance topics that decide senior roles: indexes, statistics, locking and blocking, deadlocks, query optimization
  • Practice the two non-technical questions that catch people off guard

Also: a knowledge check at the end so you know you are ready.

Candidates waiting to be called in for interviews

Hiring a DBA or developer

  • A ready-made question bank that runs from fundamentals to advanced topics
  • Model answers, so an interviewer who is not a DBA can judge a response
  • Performance questions that separate hands-on experience from resume keywords
  • Want a second opinion on a candidate? Book a free 30-minute consultation

Watch the course overview

Steve Stedman introduces the SQL Server Interview Questions and Answers course

Prefer audio? Steve and Shannon talk through DBA interview questions in Stedman SQL Podcast Season 2, Episode 5: Ace that next interview.

What you’ll learn

The lessons group into the five areas interviewers keep coming back to:

1. SQL and T-SQL fundamentals

The query questions every developer and DBA gets.

  • JOIN types, and UNION vs. UNION ALL
  • Stored procedures and functions
  • Temp tables and table variables

2. Indexing and performance

The questions that decide senior roles.

  • Clustered vs. non-clustered indexes, and partitioned tables
  • Index fragmentation and updating statistics
  • Locking, blocking, deadlocks and query optimization

3. SQL Server administration

What a DBA is expected to know cold.

  • Recovery models, backup and restore, disaster recovery
  • Log shipping, database snapshots and replication
  • SQL Agent jobs, maintenance, Database Mail, TempDB

4. Design and architecture

Showing you can think beyond a single query.

  • Normalization and creating databases
  • System databases and the transaction log
  • Sharding, web service calls and error handling

5. The non-technical questions

How you explain your thinking matters as much as the answer.

  • “Do you have any questions for me?”
  • “Tell me about a time something went really badly, and how you fixed it”
  • A knowledge check and two bonus lessons to finish

What is inside: 43 lessons in 5 sections

About 2 hours 41 minutes of video, plus a knowledge check and two bonus lessons. Start with the two free preview lessons.

Welcome (2 lessons, both free previews)
  • Welcome by Steve (3:26) Free preview
  • To get the most out of this course Free preview
Interview Questions (24 lessons)
  • Steps involved in upgrading SQL Server to a new version (8:29)
  • Managing multiple SQL Server instances (4:33)
  • Management Studio (SSMS) (4:39)
  • Creating a new database (6:58)
  • Recovery Models (5:43)
  • Backup and Restore (7:03)
  • Log Shipping (6:11)
  • System Databases (3:39)
  • Error Handling (3:30)
  • SQL Agent Jobs (5:50)
  • Index Fragmentation (7:24)
  • Transaction Log (6:07)
  • Webservice Calls (3:50)
  • Disaster Recovery (4:44)
  • Normalization (8:01)
  • Role and Configuration of TempDB
  • Configuration Manager (2:00)
  • Database Maintenance (4:30)
  • Database Mail
  • Database Snapshots (2:57)
  • Replication Types and Concepts (4:49)
  • JOIN Types (7:09)
  • Stored Procedures and Functions
  • What is Sharding? (4:27)
Performance Related Interview Questions (10 lessons)
  • Profiler and Extended Events (1:42)
  • Query Optimization (3:59)
  • Performance, tools and technique
  • UNION vs UNION ALL (4:30)
  • Temp Tables and Table Variables
  • Concept of Indexes (11:37)
  • Partitioned Tables (5:01)
  • Updating Statistics (6:17)
  • Locking and Blocking (4:22)
  • Deadlocks (4:58)
Non-Technical Questions (2 lessons)
  • Do you have any questions for me?
  • Tell me about a time something went really bad and how you fixed it?
Summary (5 lessons)
  • Test your knowledge
  • The perfect socks for your interview (0:15)
  • Bonus for you!
  • Super Bonus (2:41)
  • Thank You!

Preview the first two lessons free on Teachable.

Ready to prep? 43 lessons, lifetime access, $39.99.

Try five questions from the course

Here is the style of every lesson: the question a hiring manager asks, the answer, and the reasoning behind it.

What are the three SQL Server recovery models, and when would you choose each?

Simple, Full and Bulk-Logged. Simple truncates the transaction log at each checkpoint, so you can only restore to your last full or differential backup; it suits development systems and databases you could afford to rebuild. Full keeps every transaction in the log until you back the log up, which gives you point-in-time restore, so it is the right choice for anything in production. Bulk-Logged is Full with minimal logging for bulk loads: use it briefly during a big import, then switch back to Full and take a log backup.

Covered in: Recovery Models

What is the difference between UNION and UNION ALL, and which is faster?

Both stack the results of two queries that have matching columns. UNION removes duplicate rows from the combined result, which forces SQL Server to sort or hash every row to find those duplicates. UNION ALL keeps every row, duplicates included, and skips that work entirely. So UNION ALL is faster, often dramatically so on large sets, and it is the one to reach for whenever duplicates are impossible or acceptable. If the interviewer asks which you default to, the answer is UNION ALL unless you specifically need distinct results.

Covered in: UNION vs UNION ALL

What is the difference between a clustered index and a non-clustered index?

A clustered index defines the physical order of the table itself; the leaf level of the index is the data, so a table can have only one. A non-clustered index is a separate structure that stores the key columns in sorted order with a pointer back to the row (the clustering key, or a row ID on a heap), and a table can have many of them. Pick a narrow, unique, ever-increasing clustered key, then build non-clustered indexes that cover the queries you actually run.

Covered in: Concept of Indexes

How do you find index fragmentation, and when do you reorganize versus rebuild?

Query sys.dm_db_index_physical_stats and look at avg_fragmentation_in_percent alongside page_count. Ignore small indexes, under about a thousand pages, because fragmentation barely matters there. The common guideline is to reorganize between roughly 5 and 30 percent and rebuild above 30 percent. Reorganize is always online and can be stopped at any time; a rebuild creates a fresh copy of the index and refreshes its statistics, but it needs more log space and, unless you are on Enterprise Edition and run it ONLINE, it blocks the table. Either way, schedule it; don’t run it by hand.

Covered in: Index Fragmentation

What is a deadlock, and how do you troubleshoot one in SQL Server?

A deadlock is two or more sessions each holding a lock the other needs, so neither can finish. SQL Server detects it, picks the cheapest session to roll back, and that session gets error 1205. To troubleshoot, pull the deadlock graph from the system_health Extended Events session (or turn on trace flag 1222) and read which statements and objects were involved. The fix is usually one of: access tables in the same order everywhere, keep transactions short, add the index that turns a scan into a seek, or move readers to a snapshot isolation level.

Covered in: Deadlocks

The course works through more than 40 questions like these, most with a video walkthrough.

Meet your instructor

Steve Stedman, SQL Server consultant and course instructor

Steve Stedman has been working with SQL Server since 1990. He founded Stedman Solutions, built the Database Health Monitor monitoring tool, hosts the Stedman SQL Podcast, and teaches the courses at Stedman SQL School.

Most lessons in this course are taught by Steve, with a few from other members of the Stedman Solutions team. If a topic needs more than a video, his one-on-one mentoring picks up where the course leaves off.

What students say

Hello Steve, I just took the SQL Interviews course and found it very informative and useful. The course is helping me identify what I need to improve on with my current DBA knowledge. I will definitely recommend the course to others. Thank you very much!

Tony, course student

Read what clients and students say about working with Steve: Reviews and Raving Fans.

One price, lifetime access

$39.99

one-time payment, or pay in installments at checkout

  • All 43 lessons across 5 sections
  • About 2 hours 41 minutes of video, plus a knowledge check
  • Unlimited access that never expires
  • Two lessons free to preview before you buy
  • For candidates and for hiring managers

Secure checkout on Teachable

Questions before you enroll

How long do I have access?

The course does not expire. Enroll once and come back before every interview.

Is this live or self-paced?

Self-paced recorded video. You can start the first lesson the minute you enroll.

Is it for DBAs or for developers?

Both. The questions cover administration and development, and a third audience, hiring managers, uses it as a question bank.

Can I pay in installments?

Yes. Teachable offers an installment option at checkout.

What if I get stuck on a topic?

Steve offers one-on-one SQL Server mentoring for exactly that: a prepaid block of hours you can draw on when you need a question answered.

More from Stedman SQL School

SQL Server Performance Tuning Course

Read execution plans and fix slow queries.

View course

SQL Backup and Recovery Course

Recovery models, backup strategy and restores.

View course

SQL Server Replication Course

Snapshot, transactional and merge replication.

View course

SQL Server JOIN Types

Every JOIN type explained with examples.

View course

Want one-on-one help preparing? Ask about SQL Server mentoring.

Be ready for every question

Enroll today and start with the first two lessons free. Hiring, and want a second opinion on a candidate’s answers? Call or book a free 30-minute consultation.