typestar

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

  1. SELECT lists the columns you want, in the order you want them.
  2. AS renames a column in the result without touching the table.
  3. The trailing semicolon ends the statement.

Keywords and builtins used here

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.

Type this snippet

Step 1 of 5 in Selecting rows, step 1 of 23 in Language basics.

Next →