Skip to content
Reference notes from the interactive SQL course, which covers the same ground with a live SQL console, graded challenges and a final exam.
Getting Started

Tables, Rows, and Columns

The 4 core terms every SQL conversation uses — and what NULL really means.

Tables, Rows, and Columns

Four vocabulary words. After these, every SQL tutorial will feel approachable.

The mental model — it's a spreadsheet

A SQL table looks exactly like a spreadsheet. The terms are just more precise.

idnameemailsignup_date
1Anita Raoanita@example.com2025-08-12
2Bob Linbob@example.com2025-09-01
3Cara Patelcara@example.comNULL

Three concepts visible here:

TermWhat it isIn the example
TableThe whole gridThe 3-row block above
ColumnA vertical categoryid, name, email, signup_date
Row (also called a "record")One horizontal entryThe line 2 / Bob Lin / bob@example.com / 2025-09-01
FieldOne specific cellbob@example.com (Bob's email field)

You'll hear "row" and "record" used interchangeably. Same thing.

The fourth concept — NULL

Look at the signup_date for Cara Patel above. It says NULL.

NULL means "no value" — explicitly the absence of data.

It is NOT:

  • ❌ The number zero (0)
  • ❌ An empty string ("")
  • ❌ A space (" ")

It's a distinct thing meaning "this field has no value at all."

Why does NULL matter?

SELECT * FROM users WHERE signup_date = NULL;     -- ⚠️ Returns NOTHING
SELECT * FROM users WHERE signup_date IS NULL;    -- ✅ Returns Cara's row

You can't use = with NULL. SQL requires IS NULL or IS NOT NULL specifically. This trips up almost every beginner. Remember the rule:

NULL is not equal to anything — not even itself. Use IS NULL / IS NOT NULL.

Why all this matters

When you write a query like:

SELECT name FROM users WHERE signup_date IS NOT NULL;

You're saying:

  • "From the users table"
  • "give me the name column"
  • "for every row where the signup_date field has an actual value (not NULL)"

That's the entire mental model. Every SQL query, no matter how complex, decomposes into operations on tables, rows, columns, and fields.

Quick reference

You want to...The SQL operates on...
Get certain usersrows (filtered)
Get certain info about userscolumns (selected)
Add a new usera row (inserted)
Add a new piece of info to every usera column (added)
Change one user's emaila field (updated)

See it for yourself

Everything above is easier to believe once you have run it. This is a real employees table in a sandboxed database — press Run.

SQL
SELECT emp_id, first_name, last_name, salary
FROM employees
ORDER BY emp_id
LIMIT 5;

Five rows, four columns, and each cell is a field.

And here is a NULL

One employee has no salary recorded. Notice the result says NULL rather than showing an empty space — that difference matters, and the next lesson explains why an empty string and a NULL are not the same thing.

SQL
SELECT first_name, last_name, salary
FROM employees
WHERE salary IS NULL;

= NULL would return nothing at all here. NULL is not a value you can compare with =; it means unknown, and only IS NULL tests for it.

What's next

In the final lesson of this module, SQL Command Categories, we'll group the SQL verbs you'll use into four families — DDL, DML, DCL, DQL — so you know which category a command belongs to without having to memorize anything.

All 43 lessons in SQL — The Interactive Visual Notebook
  1. Introduction to SQL
  2. Why SQL Matters
  3. What is an RDBMS?
  4. Tables, Rows, and Columns
  5. SQL Command Categories (DDL/DML/DCL/DQL)
  6. SELECT and FROM
  7. Aliases and Expressions
  8. DISTINCT and Sorting
  9. Limiting Results
  10. Query Execution Order
  11. WHERE and Comparison Operators
  12. Combining Conditions — AND, OR, NOT
  13. IN, BETWEEN, and LIKE
  14. Working with NULL
  15. Aggregate Functions
  16. GROUP BY
  17. HAVING — Filtering Groups
  18. Grouping in Practice
  19. INNER JOIN
  20. LEFT JOIN and Outer Joins
  21. Self Joins
  22. Cross Joins and Join Pitfalls
  23. UNION, INTERSECT, and EXCEPT
  24. Subqueries
  25. EXISTS and Correlated Subqueries
  26. Common Table Expressions (WITH)
  27. Recursive CTEs
  28. Window Functions — The OVER Clause
  29. Ranking Functions
  30. Frames and Running Totals
  31. LAG and LEAD
  32. Window Function Patterns
  33. What an Index Is
  34. Reading a Query Plan
  35. Designing Indexes
  36. Writing Queries an Index Can Use
  37. Transactions and ACID
  38. Isolation Levels
  39. Locks and Deadlocks
  40. Choosing Data Types
  41. Constraints and Keys
  42. Normalisation
  43. Designing a Schema