Skip to content

SELECT & FROM

Ask for columns from a table, and read the query back as a sentence

0 of 3 done · Lesson 1 of 9

Understand

Someone asks you for a list of the customers. The table is sitting there and you could scroll it, but you would have to do it again tomorrow. A query asks for the same thing in one line, and it answers two questions in a fixed order: which columns do you want, and which table are they in. SELECT answers the first. FROM answers the second. A star means every column, so you do not have to name them one at a time. The semicolon on the end says the command has finished. Read it back as a sentence and it says what it does: show me these columns from this table.

SELECT which_columns_you_want
FROM which_table;
SELECTwhich columns you wantFROMwhich table

The tables you are working with

10 rows
First rows of the customers table
customer_idfirst_namelast_namecitycountryjoined_date
1SarahSmithAucklandNew Zealand2025-01-15
2JamesBrownWellingtonNew Zealand2025-02-03
3ArohaNgataChristchurchNew Zealand2025-02-20
4CarlosGarciaMadridSpain2025-03-11

6 more rows in the table. Your query sees all 10.

10 rows
First rows of the products table
product_idproduct_namecategorypricestock
1Coffee MugKitchen15120
2Water BottleOutdoors2580
3Hiking BackpackOutdoors12015
4NotebookStationery8.5200

6 more rows in the table. Your query sees all 10.