Manuals / SQL / Chapter 2

A · Query · beginner · Week 1 · Chapter 2 of 12

SELECT basics — reading rows

Every query starts with SELECT. Name columns explicitly in production. DISTINCT removes duplicates. Aliases rename columns or tables.

Path progress
11%

Step 1 of 3

Basic SELECT

SELECT col1, col2 FROM table. Avoid SELECT * in production — it hides schema changes and fetches unnecessary data.

Basic SELECTDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Basic SELECTdrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Example

SELECT id, name, email
FROM users;

Do this now

SQLBolt lesson 1. Save query as queries/01_select.sql.

Was this step clear?
Chapter learning outcomes
  • SELECT columns
  • DISTINCT
  • Column aliases
  • FROM and table names

Clear these before you leave

Side quest

Column audit

For each table: list columns, types, and one sample value.