SELECT
A database table is just a spreadsheet. Every row is one thing, which for us is one dish, and every column is one fact about it. Everything on this card is pulling from the same dishes table:
name station price
Bifteki grill 18
Baklava pastry 7
Melitzanosalata salad 16
Loukoumades pastry 9
Souvlaki grill 11
Dakos salad 14SELECT is how you ask for the columns you want, and FROM is how you say which table to pull them from. That's the whole idea. Everything else is just built on top of it.
Query
SELECT name FROM dishes;↓ result
name
Bifteki
Baklava
Melitzanosalata
Loukoumades
Souvlaki
DakosIf you want more than one column, you list them out with commas in between, and they come back in that same order.
Query
SELECT name, price FROM dishes;↓ result
name price
Bifteki 18
Baklava 7
Melitzanosalata 16
Loukoumades 9
Souvlaki 11
Dakos 14And when you want every column, you don't have to type them all out. A * means all columns.
Query
SELECT * FROM dishes;↓ result
You get the whole dishes table back, exactly like the one at the top of this card.
Rows come back in no particular order, and every result is itself a table. Every lesson after this one is really just you learning new ways to shape that table before it lands in front of you.
