Choorai
🌱 Lv.1

SQL Basics

SQL is the language you use to talk to a database. This page focuses on understanding data flow, not memorizing syntax in isolation. It is structured so complete beginners can follow step by step.

Learning goals for this page

  • Clearly distinguish tables, rows, and columns
  • Read and write CRUD queries
  • Understand why JOIN and INDEX are needed
  • Be ready for the next step (RDB design)

1) Core concepts first

Table

A structure that stores data with the same shape, like a sheet in a spreadsheet.

Row

One record of real data. Example: one project entry.

Column

A data attribute. Example: name, status, created_at.

A common beginner confusion is mixing up rows and columns. When SQL feels hard, first ask: "Am I selecting rows, columns, or both?"

2) Understand CRUD as a real flow

These four operations represent the core lifecycle of data in almost every service. Read them in order: create, read, update, delete.

sql
-- C: Create
INSERT INTO projects (name, status) VALUES ('admin', 'active');

-- R: Read
SELECT id, name, status FROM projects WHERE status = 'active';

-- U: Update
UPDATE projects SET status = 'archived' WHERE id = 1;

-- D: Delete
DELETE FROM projects WHERE id = 1;

How to read these quickly

  • INSERT INTO: target table for new data
  • SELECT ... FROM: columns and table to retrieve
  • WHERE: filter condition (without it, scope can be too broad)
  • UPDATE ... SET: value changes to apply

3) JOIN and INDEX in plain terms

Real apps store related data across multiple tables. JOIN combines those tables so you can read them together.

sql
SELECT p.name, u.email
FROM projects p
JOIN users u ON p.owner_id = u.id
WHERE p.status = 'active';

JOIN

Connect multiple tables using a shared key, such as user_id.

INDEX

A search helper structure, similar to a book index, used to speed up lookups.

4) Common beginner mistakes

Running UPDATE/DELETE without WHERE

This can modify or remove all rows in a table.

Mixing data types for IDs

If column types and value types do not match, filtering and joins often break.

Checklist before moving on

  • You have run CRUD queries at least once
  • You can explain JOIN as "combining related tables"
  • You understand why WHERE is critical in UPDATE/DELETE
  • Ready for next step: RDB (Lv.2)

Last updated: February 22, 2026 · Version: v0.0.1

Send Feedback

Opens a new issue page with your message.

Open GitHub Issue