SQL (Structured Query Language) is how you talk to a database. It's a simple, English-like language for working with tables — think spreadsheets with named columns like name and email, where each row is one entry.
-- Add a user
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
-- Find all users
SELECT * FROM users;
-- Change a name
UPDATE users SET name = 'Bob' WHERE email = 'bob@example.com';
-- Remove a user
DELETE FROM users WHERE email = 'alice@example.com';
That's most of what SQL does — create, read, update, delete (often called CRUD). You can read it almost like English.
Before you can store data, the table itself needs to exist. SQL can create one and change it later:
CREATE TABLE users (
name TEXT,
email TEXT,
age INTEGER
);
When you need to change a table later — say, add a phone number — that's an ALTER TABLE:
ALTER TABLE users ADD COLUMN phone TEXT;
These structural commands are called DDL (Data Definition Language). You won't write them — Atlas generates them from your Drizzle schema — but you'll see them when Atlas asks you to review before applying.
In your starter, your TypeScript models handle SQL for you. Instead of writing SELECT * FROM users WHERE email = '...', you write:
User.findBy({ email: 'alice@example.com' })
And Atlas handles the table creation and structural changes when your schema changes.
So why learn SQL at all?
When Atlas shows you what it's about to apply, knowing the basics helps you read what's happening.
And when a model query returns wrong results, you can turn on debug: true to see the actual SQL the ORM is issuing. Recognizing what that SQL means makes debugging much faster — even if you throw it to your AI to figure out.