Topic practice collection

SELECT Statements SQL practice questions

Select columns, filter rows, remove duplicates, and order query results.

Exercises
12
Difficulty
Beginner

What this collection tests

Skills and query patterns

SELECT, aliases, DISTINCT, filtering, and ordering

Curated exercises

Choose a problem

Work in the live editor where supported. Advanced guided labs state their engine boundary before you open the workspace.

  1. Problem 1Easy

    Basic SELECT - All Columns

    Return every column from the employees table.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  2. Problem 2Easy

    SELECT Specific Columns

    Return first_name, last_name, and salary from employees.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  3. Problem 3Easy

    SELECT DISTINCT

    Return distinct department IDs from employees.

    • Distinct values

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  4. Problem 4Easy

    SELECT with Column Aliases

    Return first_name and last_name using friendly aliases.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  5. Problem 5Easy

    SELECT with Expressions

    Return employee names with bonus calculated as salary * 0.10.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  6. Problem 6Easy

    Reorder the Projected Columns

    Return salary, last_name, and first_name in that exact left-to-right order.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  7. Problem 7Medium

    DISTINCT on Multiple Columns

    Return every unique department_id and job_id combination.

    • Sorting
    • Distinct values

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  8. Problem 8Easy

    Use a Table Alias

    Alias employees as e and return e.first_name with e.salary.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  9. Problem 9Easy

    Add a Constant Literal Column

    Return first_name with a constant record_type value of Employee.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  10. Problem 10Medium

    NULL-Aware Arithmetic

    Return salary plus manager_id for each employee as salary_plus_manager.

    • NULL handling

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  11. Problem 11Easy

    SELECT Without FROM

    Return 1 + 1 as result.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
  12. Problem 12Hard

    Capstone — Compose a Projection

    Return staff_id, first_name, last_name, record_type, bonus, and salary_plus_manager.

    SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

    Open problem →
01

Attempt

Write a query or design from the brief before opening any hints.

02

Validate

Run it against the included dataset and inspect the output.

03

Explain

Compare the verified answer and explain each choice aloud.

Learn before practicing SELECT Statements

Strengthen your understanding with these targeted learning topics: