Overview
Microsoft SQL Server is a relational database management system (RDBMS) used by businesses of every size. You interact with it using Transact-SQL (T-SQL), Microsoft's version of the SQL language. The current version is SQL Server 2025.
To manage SQL Server and write queries, you use a separate tool, SQL Server Management Studio (SSMS). In this guide you will install the free Developer edition of SQL Server and SSMS, connect to your server, and run a beginner T-SQL example.
localhost and run queries.
SQL Server Editions
| Edition | Cost | Use |
|---|---|---|
| Standard Developer | Free | Development and learning on Windows 10 or 11, with Standard edition features. New in SQL Server 2025, and the choice for most students. |
| Enterprise Developer | Free | Development and testing with all Enterprise features. Microsoft lists it for Windows Server, not Windows 10 or 11. |
| Express | Free | Small production databases, with limits on database size, memory, and CPU. |
| Standard and Enterprise | Paid | Production systems for businesses. |
The two Developer editions include the same database engine as the paid editions, but their license does not allow production use.
Requirements
- A 64-bit Windows computer with an Intel or AMD (x64) processor: Windows 10 or 11, or Windows Server. Windows on ARM computers are not supported. Check Microsoft's hardware and software requirements for the exact supported versions.
- At least 4 GB of RAM (8 GB or more recommended) and about 10 GB of free disk space.
- Administrator privileges.
- Internet access.
Important Notes
- Mac users: SQL Server and SSMS don't run on macOS. Use a Windows virtual machine or a campus computer, or run SQL Server for Linux in a Docker container (an advanced option not covered here).
- SQL Server also runs on Linux. See Microsoft's SQL Server on Linux documentation.
- SQL Server runs in the background as a Windows service, so it uses memory even when SSMS is closed.
Installation Instructions
Work through the tabs in order.
Installing SQL Server and SSMS
Click the tabs above in order. Allow about 30–45 minutes.
The guide covers these major tasks:
- Download the SQL Server installer.
- Install the Developer edition.
- Download SSMS.
- Install SSMS.
- Connect SSMS to your server.
- Confirm the version.
Beginner Example: A Course Enrollment Database
You will create a database with two related tables, add data, and query it. Click New Query in SSMS for each step, type or paste the code, and press F5 to run it.
Step 1: Create the database
CREATE DATABASE SchoolDB;
GO
USE SchoolDB;
GO
GO tells SSMS to run everything above it as one batch. After running, right-click Databases in Object Explorer and choose Refresh to see SchoolDB.
Step 2: Create two related tables
CREATE TABLE Students (
StudentID INT IDENTITY(1,1) PRIMARY KEY,
FirstName NVARCHAR(50) NOT NULL,
LastName NVARCHAR(50) NOT NULL,
Major NVARCHAR(50) NULL
);
CREATE TABLE Enrollments (
EnrollmentID INT IDENTITY(1,1) PRIMARY KEY,
StudentID INT NOT NULL REFERENCES Students(StudentID),
Course NVARCHAR(20) NOT NULL,
Grade DECIMAL(3,1) NULL
);
IDENTITY(1,1) numbers new rows automatically, starting at 1. REFERENCES creates a foreign key so every enrollment must belong to an existing student.
Step 3: Insert data
INSERT INTO Students (FirstName, LastName, Major)
VALUES ('Ana', 'Lopez', 'Information Systems'),
('Ben', 'Carter', 'Accounting'),
('Chloe', 'Nguyen', 'Information Systems');
INSERT INTO Enrollments (StudentID, Course, Grade)
VALUES (1, 'IS 4420', 3.7),
(1, 'IS 2010', 4.0),
(2, 'IS 4420', 3.3),
(3, 'IS 4420', 3.9),
(3, 'IS 2010', 3.5);
Step 4: Query the data
-- All students
SELECT * FROM Students;
-- Each student's enrollments, joining the two tables
SELECT s.FirstName, s.LastName, e.Course, e.Grade
FROM Students AS s
JOIN Enrollments AS e ON e.StudentID = s.StudentID
ORDER BY s.LastName, e.Course;
-- Average grade per course
SELECT Course, COUNT(*) AS Students, AVG(Grade) AS AvgGrade
FROM Enrollments
GROUP BY Course
ORDER BY Course;
The last query returns:
Course Students AvgGrade
IS 2010 2 3.750000
IS 4420 3 3.633333
Step 5: Update and delete
UPDATE Students SET Major = 'Finance' WHERE StudentID = 2;
DELETE FROM Enrollments WHERE Course = 'IS 2010' AND StudentID = 3;
SELECT * FROM Students WHERE StudentID = 2;
Always include a WHERE clause with UPDATE and DELETE; without one, every row in the table changes.
Starting Over
To remove the practice database and start again, run:
USE master;
GO
DROP DATABASE SchoolDB;
GO
Next Steps
- Practice creating diagrams of your tables with Database Diagrams in Object Explorer.
- Compare SQL Server with MySQL and SQLite.
- Work through Microsoft's T-SQL reference and tutorials.
- SQL Server Developer edition is free for development and learning, but not for production.
- Install the database engine first, then SSMS.
- Connect to
localhostwith Windows Authentication and Trust server certificate checked. - Use
WHEREcarefully withUPDATEandDELETE.