← Back to the Build Your Homepage series
💾
EPISODE 02
SELECT · INSERT · UPDATE · DELETE · WHERE · ORDER BY

SQL Basics

Learn the four core SQL operations (CRUD) plus filtering, sorting, and limiting. Practice on a sample SQLite database.

SQLSELECTCRUDWHEREORDER BY
Duration
About 2 hours
Level
📊 Beginner+
Prerequisite
🎯 db-01
OUTCOME
Read and write data in any SQL database with the four core verbs

What you'll learn

  • 1Run SELECT queries with WHERE, ORDER BY, LIMIT
  • 2INSERT new rows safely
  • 3UPDATE and DELETE with WHERE
  • 4Use comparison and logical operators correctly

1. SELECT

sql
SELECT * FROM users;
SELECT name, email FROM users;

SELECT name FROM users
WHERE age >= 18 AND city = 'Seoul'
ORDER BY name ASC
LIMIT 10;

2. INSERT

sql
INSERT INTO users (name, email, age)
VALUES ('Alice', 'alice@example.com', 30);

-- Multiple rows
INSERT INTO users (name, email) VALUES
  ('Bob',   'bob@example.com'),
  ('Carol', 'carol@example.com');

3. UPDATE & DELETE

sql
UPDATE users SET age = 31 WHERE id = 1;

DELETE FROM users WHERE id = 2;
⚠️

Always include WHERE on UPDATE and DELETE — without it, the change affects every row in the table.

4. Operators

OperatorExample
=, <>WHERE id = 1, WHERE status <> 'done'
<, <=, >, >=WHERE age >= 18
AND, OR, NOTWHERE a = 1 AND b = 2
INWHERE city IN ('Seoul', 'Busan')
BETWEENWHERE price BETWEEN 100 AND 200
LIKEWHERE name LIKE 'A%' (starts with A)
IS NULLWHERE deleted_at IS NULL
Example code / lecture materials

All lecture materials and example code are openly available on GitHub.

View on GitHub ↗