What is SQL, actually?
Databases, tables and your very first question, explained with a sushi restaurant.
Imagine you run a sushi restaurant. Orders come in all evening: maki for table 5, nigiri for table 3, another maki for table 2. If you scribble them on random napkins, tomorrow you know nothing. Which dish sold best? No idea. The napkins are gone.
A database is the opposite of napkins. It is a place where information is written down so tidily that you can find anything again in a blink.
Everything lives in tables
Inside a database, information sits in tables. A table is just a grid, like a very disciplined notebook page:
Read it like this:
- Every row is one thing that happened. One order, one customer, one sale.
- Every column is one kind of fact. What was ordered, how many, for which table.
That is genuinely all a table is.
SQL is how you ask questions
You do not dig through the table yourself. You ask, and the database fetches. SQL (Structured Query Language, said as “sequel” or “ess-cue-ell”) is the language for asking:
The magic part: the same question works whether the table holds ten orders or ten million. You describe what you want, never how to find it. The database figures that out on its own.
What can you ask?
More than you would think. With a few words of SQL you can:
- find things: all orders from table 5
- count things: how many maki went out tonight?
- sort things: the top three bestsellers
- combine things: orders together with prices (that is a JOIN, a later lesson)
Where do you try it?
You do not need to install anything to start:
Start in a browser playground. When that feels easy, a tiny database like SQLite or DuckDB lives happily as a single file on your laptop.
Try this yourself
Open an online playground (search for “SQLite online” or “DB Fiddle”) and type exactly this:
SELECT 'hello, kitchen!';Press run. The database answers. That round trip, question in, answer out,
is the entire game. Next lesson: asking for real rows with SELECT and
WHERE.