Lesson Description
Pick the columns you want from a table.
Lesson 1 of 5
Progress: 0/4 exercises solved (0%)
Solve all exercises below to unlock the next lesson.
Lesson Description
Pick the columns you want from a table.
Easy Project
Mini project: Turn this lesson into a real-world query artifact by writing one clean business report query and validating output quality.
Every SQL query starts with SELECT. It tells the database which columns to return.
SELECT column1, column2
FROM table_name;
Listing columns explicitly is best practice — it self-documents intent and is resilient to schema changes.
SELECT first_name, last_name, salary
FROM employees;
Returns every column. Useful for quick exploration, but avoid it in production — future columns appear automatically and can break downstream code.
SELECT * FROM employees;
AS renames a column in the result set. The underlying table is unchanged.
SELECT
first_name AS given_name,
salary AS monthly_pay
FROM employees;
Arithmetic and string operations work directly in SELECT:
SELECT
first_name,
salary * 12 AS annual_salary,
first_name || ' ' || last_name AS full_name
FROM employees;
FROM specifies the source table.SELECT cannot be referenced in WHERE — they do not exist yet at that stage.WHERE, every row is returned.This lesson is part of SQL Fundamentals. Focus on the core idea in SELECT: choosing columns, then validate with deliberate practice.
What to master
Common mistakes
High-level strategy
Task ladder
Transparent data checks
Retention loop
Logical reasoning for commands
WHERE
Why: Limits rows to only the business-relevant subset.
Memory cue: Filter early to reduce noise.
ORDER BY
Why: Makes output deterministic and reviewable.
Memory cue: No ORDER BY means no guaranteed row order.
AS alias
Why: Makes output columns readable for teams and reports.
Memory cue: If the name is clear, the query is easier to trust.
Concept check
3 quick questions. One at a time. Instant score at the end.
Return the first_name and last_name of every employee.
Return every employee's first_name and their salary aliased as monthly_pay.
Return first_name, last_name, and salary * 12 aliased as annual_salary for every employee.
Return title, min_salary, and max_salary from the jobs table, ordered by min_salary ascending.
Lesson 1 of 5
0/4 solved (0%)
Finish this lesson to unlock next.