Blog · Guide

How SQL SELECT Works (Pick Columns from a Table)

SELECT is how you ask a table for data. Here’s the shape of a query, what * means, and how to pick only the columns you need.

customers first_name last_name city result first_name · city
SELECT chooses which columns appear in the result.

The smallest useful query

Every read query starts with the same idea: which columns, from which table.

SELECT first_name, last_name
FROM customers;

Read it left to right: “Give me first_name and last_name from the customers table.”

What about SELECT * ?

SELECT * means “all columns.” It’s fine for exploring. In real work you’ll usually name columns so the result stays readable and stable when the table gains new fields.

Order of writing (and thinking)

You often think FROM first (“I’m looking at customers”), then SELECT (“I need these columns”), then WHERE / ORDER BY. SQL’s written order is SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY → LIMIT — but the engine mostly starts from FROM.

Try it yourself

The fastest way to lock this in is a short drill on the same Northstar Market tables.

Practice SELECT columns

Related guides