Overview
A database is organized storage for data. Tables hold related records. SQL is the language for asking questions about that data.
On this page7 sections
The idea
A database is software that stores data in an organized way. Instead of keeping information in scattered files and folders, a database uses tables with strict rules about what each column can hold. A relational database stores data in tables that can reference each other through shared columns.
SQL (Structured Query Language, pronounced 'sequel' or 'S-Q-L') is the language you use to communicate with a database. You write a question in SQL, and the database returns the answer as rows and columns. SQL has been the standard language for databases since the 1970s and is used by virtually every data tool today.
Why this exists
Imagine a bank that stores customer information in one system, account balances in another, and transaction records in a third. Without a database that connects these systems, a bank teller cannot see your full account history when you call with a question.
A relational database solves this by storing customers, accounts, and transactions in separate tables that reference each other through shared columns like customer_id. One SQL query can combine data from all three tables to show a complete picture.
Picture this
Tables store data. SQL queries retrieve it. Results come back as rows and columns.
This track focuses on relational databases because they are the foundation of data warehousing.
| Database type | Examples | Best for |
|---|---|---|
| Relational (SQL) | PostgreSQL, MySQL, Snowflake, BigQuery | Structured data with relationships |
| Document | MongoDB, DynamoDB | Semi-structured JSON documents |
| Key-value | Redis, DynamoDB | Fast lookups by a single key |
| Column-family | Cassandra, HBase | Wide tables with many columns |
The SQL editor in this tab is a relational database with several tables already loaded: orders, order_items, payments, ecommerce_events, telemetry, and customer history. You do not need to install anything. Just write SQL and see results.
A query is a question written in SQL. The database reads the query, finds matching rows, and returns a result table. You do not move files around. You ask, and the engine answers.
A small example
Run the example below in this tab. Read the input, follow the code, then check the output matches what you expect.
SELECT order_id, order_total
FROM orders
WHERE order_status = 'paid'
LIMIT 5;Read it in English: from the orders table, keep paid rows, return two columns, stop after five rows. That is the same idea as filtering a spreadsheet, with rules the database enforces.
A library with a perfect index
A database is like a library where every book (row) is filed by topic (table), and you can find any book instantly with the right question (SQL query).
Copy-paste without reading the output
Run Sample first. If the numbers or row count look wrong, stop and re-read the previous section before changing code.
Common beginner questions
What is the difference between a database and a spreadsheet?
A spreadsheet stores data in one big grid. A database stores data in multiple related tables, enforces data types, supports millions of rows efficiently, and allows multiple users to query simultaneously.
Do I need to install a database to learn SQL?
Not here. The SQL editor runs in your browser with real tables already loaded. On the job, you will connect to databases hosted in the cloud (Snowflake, BigQuery, Redshift) or on company servers.
What comes next
In the next lesson, you will look closely at tables, rows, and columns. You will learn how data types work and why they matter for data quality.
Practice
Run Sample to see all tables available in this SQL editor with SHOW TABLES. Then complete Exercise: preview the payments table with SELECT * FROM payments LIMIT 5.