SELECT columns in SQL
The shape of every query: pick columns, name a table, alias the output.
SELECT
id,
name AS full_name,
email
FROM users;
How it works
SELECTlists the columns you want, in the order you want them.ASrenames a column in the result without touching the table.- The trailing semicolon ends the statement.
Keywords and builtins used here
ASFROMSELECT
The run, in numbers
- Lines
- 5
- Characters to type
- 47
- Tokens
- 11
- Three-star pace
- 70 tpm
At the three-star pace of 70 tokens a minute, this run takes about 9 seconds.
Step 1 of 5 in Selecting rows, step 1 of 23 in Language basics.