LearnThatStack Ace your next interview
Database Technologies

SQL Server.

Start free Change topic Change
Practice · Questions

All questions

Showing of 47
Beginner 11
01

What is SQL Server and what are its main components?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

SQL Server is Microsoft's relational database management system (RDBMS), queried with T-SQL, Microsoft's dialect of SQL. It runs on Windows and Linux, and Azure SQL Database runs the same engine in the cloud. Its main components are:

  • The Database Engine, the core service for storing, processing and securing data.
  • SQL Server Agent, for job scheduling and automation.
  • SQL Server Integration Services (SSIS), for data integration and transformation.
  • SQL Server Analysis Services (SSAS), for analytical models. Its data mining feature was discontinued in SQL Server 2022.
  • SQL Server Reporting Services (SSRS), for reports. From SQL Server 2025, on-premises reporting moves to Power BI Report Server.

SQL Server Management Studio (SSMS) is the main management and development tool. It is a separate client tool that also manages Azure SQL Database.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What are the different data types in SQL Server?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

SQL Server groups its data types by what they hold, mainly numbers, strings and dates. The type decides how much space a column takes and which values it accepts.

  • Exact numbers: TINYINT, SMALLINT, INT, BIGINT, DECIMAL, NUMERIC, MONEY
  • Approximate numbers: FLOAT, REAL
  • Strings: CHAR, VARCHAR, NCHAR, NVARCHAR
  • Dates and times: DATE, TIME, DATETIME, DATETIME2, SMALLDATETIME, DATETIMEOFFSET
  • Binary: BINARY, VARBINARY
  • Special: BIT, UNIQUEIDENTIFIER, XML

TEXT, NTEXT and IMAGE still exist, but they are deprecated. New code uses VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) instead.

SQL Server 2016 added JSON functions for JSON stored in NVARCHAR strings. A native JSON data type arrived only in SQL Server 2025 and Azure SQL Database.

Example:

CREATE TABLE Employee (
    ID INT,
    Name NVARCHAR(50),
    Salary DECIMAL(10,2),
    HireDate DATETIME
);
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is the difference between VARCHAR and NVARCHAR?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

VARCHAR stores non-Unicode text in the code page of the column's collation, the character set that collation supports. NVARCHAR stores Unicode text, so it can hold any language.

  • VARCHAR(n): n is a size in bytes, up to 8,000. With a single-byte collation such as a non-UTF-8 Latin one, each character takes 1 byte. It suits text that fits one code page, such as English.
  • NVARCHAR(n): n is a size in byte-pairs, up to 4,000. Most characters take 2 bytes. Supplementary characters, those outside the basic Unicode range such as many emoji, take 4.

NVARCHAR needs more storage but supports international text. Unicode literals need the N prefix, as in N'Zürich', or they are converted to the database code page and can lose characters. From SQL Server 2019, a UTF-8 collation lets VARCHAR store Unicode too.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

Explain different types of JOIN operations.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A join combines rows from two tables based on a related column, and the join type decides what happens to rows that have no match.

  • INNER JOIN returns only the rows that match in both tables.
  • LEFT JOIN returns all rows from the left table and the matching rows from the right.
  • RIGHT JOIN returns all rows from the right table and the matching rows from the left.
  • FULL OUTER JOIN returns all rows from both tables, with NULL where a side has no match.
  • CROSS JOIN returns the Cartesian product, every row paired with every row.

Rows with a NULL join key never match, so an inner join drops them.

T-SQL adds CROSS APPLY and OUTER APPLY, which run a table-valued function or subquery once for each left row. CROSS APPLY keeps only left rows that get a result, and OUTER APPLY keeps every left row, with NULL when nothing comes back.

Example:

-- INNER JOIN
SELECT e.Name, d.DepartmentName
FROM Employees e
INNER JOIN Departments d ON e.DeptID = d.ID;
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What are PRIMARY KEY and FOREIGN KEY constraints?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A PRIMARY KEY uniquely identifies each row in a table, and a FOREIGN KEY makes a column refer to another table's primary key. A primary key can't be NULL, it must be unique, and a table has only one. SQL Server enforces it with a unique index, clustered by default when the table has no clustered index yet.

A foreign key rejects a value with no matching primary key in the parent table, though NULL is allowed. By default, deleting a parent row that still has child rows fails with an error. With ON DELETE CASCADE, the child rows are deleted too, and with ON DELETE SET NULL, their foreign key becomes NULL.

Example:

CREATE TABLE Departments (
    ID INT PRIMARY KEY,
    Name NVARCHAR(50)
);

CREATE TABLE Employees (
    ID INT PRIMARY KEY,
    Name NVARCHAR(50),
    DeptID INT FOREIGN KEY REFERENCES Departments(ID)
);
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is the difference between DELETE, TRUNCATE, and DROP?

Part of Pro
07

What are indexes and why are they important?

Part of Pro Visual
08

What is a View in SQL Server?

Part of Pro
09

What are Stored Procedures and their advantages?

Part of Pro
10

What is normalization, and what are the normal forms?

Part of Pro
11

What is the difference between UNION and UNION ALL?

Part of Pro
Intermediate 18
12

Explain the difference between clustered and non-clustered indexes.

Part of Pro Visual
13

What are window functions and how do they work?

Part of Pro
14

Explain transaction isolation levels in SQL Server.

Part of Pro
15

What are triggers and what types exist?

Part of Pro
16

Explain different types of backups in SQL Server.

Part of Pro
17

What are CTEs (Common Table Expressions)?

Part of Pro
18

What is deadlock and how can it be prevented?

Part of Pro Visual
19

Explain the MERGE statement.

Part of Pro Visual
20

What are user-defined functions and their types?

Part of Pro
21

What is the difference between a temporary table and a table variable?

Part of Pro
22

What is Query Store and how does it help with performance tuning?

Part of Pro
23

How do you manage index fragmentation in SQL Server?

Part of Pro Visual
24

How do you handle errors in a T-SQL stored procedure?

Part of Pro
25

What is the difference between EXEC and sp_executesql for dynamic SQL?

Part of Pro
26

What is the difference between a function and a stored procedure in SQL Server?

Part of Pro
27

What are the different types of replication in SQL Server?

Part of Pro
28

What is log shipping in SQL Server, and how does it work?

Part of Pro
29

What are statistics in SQL Server, and how are they kept up to date?

Part of Pro Visual
Expert 18
30

How do you analyze and optimize query performance?

Part of Pro
31

Explain table partitioning and its benefits.

Part of Pro Visual
32

Explain Always On Availability Groups.

Part of Pro Visual
33

What is parameter sniffing and how do you handle it?

Part of Pro Visual
34

Explain columnstore indexes and their use cases.

Part of Pro
35

What are memory-optimized tables (In-Memory OLTP)?

Part of Pro
36

How do you implement and manage database security?

Part of Pro
37

Explain query hints and when to use them.

Part of Pro
38

What are Extended Events and how are they used for monitoring?

Part of Pro
39

How do you handle large data migrations and ETL processes?

Part of Pro
40

Explain the difference between SNAPSHOT isolation and READ COMMITTED SNAPSHOT.

Part of Pro Visual
41

What is Resource Governor and how is it used?

Part of Pro
42

How do you implement database compression in SQL Server?

Part of Pro
43

What are Filegroups and how do you use them effectively?

Part of Pro
44

What is tempdb used for, and how do you configure it?

Part of Pro
45

How do you use wait statistics to troubleshoot SQL Server performance?

Part of Pro Visual
46

What types of locks does SQL Server use, and what is lock escalation?

Part of Pro
47

What is the difference between a latch and a lock in SQL Server?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for SQL Server? Send them this set.
Pro · $10/mo

42 of 47 SQL Server answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git