Introduction to SQL
SQL (Structured Query Language) is the standard language for communicating with relational databases. Almost every data tool you'll encounter — data warehouses, BI platforms, dbt — speaks SQL under the hood.
This lesson is a work in progress. Content will be expanded with examples, exercises, and a video walkthrough.
What Is a Relational Database?
A relational database organizes data into tables (rows and columns), similar to a spreadsheet. Each table represents one type of entity — for example, orders, customers, or products. Tables are linked together through keys.
Your First Query
The most basic SQL query retrieves all rows from a table:
SELECT *
FROM orders;
To retrieve specific columns:
SELECT
order_id,
customer_id,
order_date,
total_amount
FROM orders;
Filtering Rows with WHERE
Use WHERE to return only the rows that meet a condition:
SELECT
order_id,
customer_id,
total_amount
FROM orders
WHERE total_amount > 100;
What's Next
In the next lesson you'll learn how to aggregate data — counting rows, summing values, and grouping results.