SQL — talking to databases
The language databases understand
⏱ Est. ~4 min
01 · Read
You already know databases store data in organized tables. But how do you actually put data in and pull it back out? With SQL (Structured Query Language).
SQL is a language designed for one thing: talking to databases. You write a SQL query, the database reads it, and sends results back. It's like ordering at a restaurant — you tell the kitchen what you want, and they bring it out.
Key points
- SQL stands for Structured Query Language (pronounced "sequel" or S-Q-L)
- It has a few English-like commands: SELECT, INSERT, UPDATE, DELETE
- Almost every relational (table-based) database speaks SQL
- You don't need to memorize complex syntax — the basics are actually pretty readable
02 · Code example
Here are four basic SQL commands. Each one does exactly what its name suggests.
Get all users
SELECT * FROM users;
Filter by name
SELECT * FROM users WHERE name = 'Sara';
Add a new user
INSERT INTO users (name, email)
VALUES ('Morgan', 'morgan@email.com');
Update a user
UPDATE users SET email = 'new@email.com'
WHERE name = 'Sara';
Delete a user
DELETE FROM users WHERE name = 'Morgan';
See how readable SQL is — it almost reads like English. SELECT means "give me", FROM means "from this table", WHERE means "only rows that match this condition." You don't need to be an engineer to figure out what these queries do.
03 · Match
Match each SQL keyword to what it does.
(This section is interactive — please enable JavaScript.)
04 · Read
These four commands — SELECT, INSERT, UPDATE, DELETE — are often called CRUD (Create, Read, Update, Delete) operations. They cover the vast majority of what apps do with databases.
Every time you sign up for a service, that's an INSERT. Every time you scroll a feed, that's a SELECT. Every time you edit your profile, that's an UPDATE. And when you delete your account, well, that's a DELETE.
05 · Fill in the blank
The four main SQL operations — Create, Read, Update, Delete — are often called by the acronym ___.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.