0Pricing
SQL Academy · Lesson

Selecting Columns and Expressions

Project columns, compute derived expressions, alias results with AS, and use DISTINCT to remove duplicates.

The Basic SELECT

SELECT projects columns from one or more tables.

SELECT id, email, full_name
FROM users;

SELECT *

SELECT * returns every column. Convenient in the REPL, bad in production code:

  • Returns more bytes than you need
  • Breaks when columns are added or reordered
  • Hides intent in code review

All lessons in this course

  1. Selecting Columns and Expressions
  2. WHERE Filters: Comparison and Logic Operators
  3. ORDER BY Single and Multiple Columns
  4. LIMIT, OFFSET and Pagination Basics
← Back to SQL Academy