SQL SELECT
The command you'll type more than any other — it decides which columns come back, and nothing else.
What & Why
SELECT is how you choose which columns of a table you want returned. It doesn't filter rows (that's WHERE) and it doesn't limit how many come back (that's LIMIT) — it only decides which columns show up in the result.
See How It Works
BUSINESS QUESTION
Marketing wants a report that only shows campaign names and spend values — nothing else in the table.
Watch SELECT narrow the columnsStep 1 of 3
SELECT * FROM marketing.campaigns
| id | name | channel | spend | start_date | status |
|---|---|---|---|---|---|
| 1 | Spring Launch | google_ads | 55000 | 2024-01-15 | active |
| 2 | Retention Webinar | 45000 | 2024-02-10 | active | |
| 3 | Finance Retargeting | 50000 | 2024-03-12 | active |
SELECT * keeps every column.
Syntax Pattern
See explanation
SELECT column_1, column_2
FROM schema.table_name;
-- Explore every column
SELECT *
FROM schema.table_name
LIMIT 10;Now You Try
Practice this concept
Marketing wants a report that contains only each campaign name and spend value.
Available schema
marketingPrefix tables with marketing.table_name.
namespendmarketing.campaigns| Column | Type |
|---|---|
| id | integer |
| name | text |
| channel | text |
| spend | numeric |
| start_date | date |
| end_date | date |
| status | text |
| target_segment | text |
| legacy_id | text |
query.sql
Sign up free to try it on a real business scenario