HomeAll tracks · pricing · account
Python11 apps · Python, SQL & data
Start free Log in
Subscribe to unlock this lesson.
← PostgreSQL 0 / 9
Starting PostgreSQL in your browser… (first time ~3 MB, then cached)

Lesson 01Querying basicsFoundation

SELECT: ask for the columns you need

A query names the columns it wants and the table they live in. PostgreSQL hands back a new table: the result.

You’ll useSELECT · FROM · column lists · * · AS · expressions

Watch the query work

Every query you will write starts here. `SELECT` says **which columns** you want, `FROM` says **which table** they come from, and the answer is always a fresh table of rows. We'll ask the café's `products` table a few questions.

The trace starts as soon as PostgreSQL is ready…

The mental modelA query never changes the table it reads. It builds a **new result table**: one output row per input row (until you filter), with exactly the columns you list, in the order you list them.
Why it mattersReal tables have dozens of columns. Naming only the ones you need keeps results readable, keeps reports stable when someone adds a column, and moves less data across the network.

🐘 Open the 🗂 Tables panel any time to see every table and column of the café database.