SQL (Structured Query Language) is the standard language for working with relational databases. You use it to define structure, insert and update data, and ask questions of the data in a clear, structured way.
In this module we use SQLite as the DBMS—the software that stores your database files and runs your SQL. The language itself is SQL; what you learn applies across PostgreSQL, MySQL, SQL Server, and other relational systems, even if each product adds a few extras or small variations.
What makes SQL special?
Unlike many programming styles where you spell out every low-level step, SQL is declarative: you describe the result you want, and the database engine plans how to produce it. That keeps queries readable and lets the system optimize execution.
SQL’s evolution and standardization
SQL has evolved through ISO/ANSI standards over decades (for example SQL-92 as a common baseline, with later revisions adding features). Shared standards are why SQL skills transfer between jobs and products, even when vendors document their own dialects.
Real-world example
To list every row in a customers table where the city is New York:
SELECT * FROM customers WHERE city = 'New York';The engine applies the condition and returns matching rows; you do not manually loop through the table.
Why learn SQL?
Relational databases store values in columns. Each column has a type (or is compatible with a set of types) so the system knows how to store, compare, and compute on the data.
Module note: We run exercises with SQLite as the DBMS. The types below are general SQL ideas—names and details may vary slightly by product, but the categories stay the same.
INTEGER / INT — whole numbersDECIMAL / NUMERIC — exact fractions (e.g. money)FLOAT / REAL — approximate floating-pointCHAR / VARCHAR / TEXTDATE, TIME, TIMESTAMP (or DATETIME)BOOLEAN — true/false in queries (physical storage varies)NULL — unknown / not applicable (not zero or '')| Category | Examples | Typical use |
|---|---|---|
| Numeric | INTEGER, DECIMAL, FLOAT | Counts, money, measurements |
| Text | VARCHAR, TEXT | Names, descriptions, codes |
| Date & time | DATE, TIMESTAMP | Events, schedules, logs |
| Other | BOOLEAN, NULL | Flags, optional fields |
Choosing sensible types keeps data valid, makes sorting and comparisons behave as you expect, and helps the engine store and index data efficiently.
Later lessons go into syntax in detail; here is the shape almost every read query follows.
The foundation: SELECT
Data retrieval starts with SELECT: which columns (or expressions) you want, from which tables, with which filters and ordering.
SELECT [what you want to see]
FROM [which table]
WHERE [conditions]
ORDER BY [how to sort];Sorting: ORDER BY
That pattern—choose columns, restrict rows, sort—is the backbone of asking questions of relational data in SQL.
Next you will write more SQL step by step: choosing columns, filtering, and combining ideas to answer concrete questions—still in standard SQL, using SQLite in this module as the engine that runs it.