SQL (Structured Query Language) is the standard language used to create, read, update, and delete data stored in a relational database. If you've ever filtered a spreadsheet, searched a product catalog, or checked your bank transaction history, something behind the scenes very likely ran a SQL query to fetch that data for you.

A relational database organizes data into tables, where each table has a fixed set of columns (the fields, like name or salary) and any number of rows (the individual records). Tables can also be related to one another — for example, an orders table might reference a customers table through a shared customer ID — which is where the "relational" in relational database comes from.

A Simple Example Table

Throughout this tutorial series, we'll reuse a simple employees table to keep examples consistent:

CREATE TABLE employees (
    id INT PRIMARY KEY,
    name VARCHAR(50),
    department VARCHAR(50),
    salary DECIMAL(10, 2),
    hire_date DATE
);

Once a table like this exists and has data in it, SQL lets you ask questions of it — "which employees work in Engineering?", "who was hired this year?", "what's the average salary per department?" — and get back exactly the rows you need.

The Main Categories of SQL Statements

SQL statements are usually grouped into a few categories based on what they do:

-- DDL (Data Definition Language) — defines structure
CREATE TABLE employees (...);
ALTER TABLE employees ADD COLUMN email VARCHAR(100);

-- DML (Data Manipulation Language) — changes data
INSERT INTO employees (id, name, department, salary, hire_date)
VALUES (1, 'Alice Chen', 'Engineering', 95000, '2023-03-14');

-- DQL (Data Query Language) — reads data
SELECT name, department FROM employees;

In practice, most of the day-to-day SQL you'll write falls into DQL — querying and shaping data you already have — which is why the SELECT statement is usually the very first thing people learn.

Why SQL Still Matters

SQL has been the standard for relational databases since the 1970s, and it remains the primary way applications, analysts, and data scientists interact with structured data today — whether that database is MySQL, PostgreSQL, SQL Server, or SQLite. The core syntax you'll learn in this series is portable across almost all of them, with only minor differences in advanced features. Once you're comfortable filtering rows with the WHERE clause, you already have the foundation for everything else in this course, from joins to aggregation.