SQL Topic collection
SELECT Statements SQL Topic exercises
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 an exercise
Work in the live editor where supported. Advanced guided labs state their engine boundary before you open the workspace.
- Exercise 1Easy
Basic SELECT - All Columns
Return every column from the employees table.
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 2Easy
SELECT Specific Columns
Return first_name, last_name, and salary from employees.
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 3Easy
SELECT DISTINCT
Return distinct department IDs from employees.
- Distinct values
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 4Easy
SELECT with Column Aliases
Return first_name and last_name using friendly aliases.
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 5Easy
SELECT with Expressions
Return employee names with bonus calculated as salary * 0.10.
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 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 exercise → - Exercise 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 exercise → - Exercise 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 exercise → - Exercise 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 exercise → - Exercise 10Medium
Calculate Monthly Salary
Return each employee’s annual salary and calculated monthly salary.
- Numeric functions
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 11Easy
SELECT Without FROM
Return 1 + 1 as result.
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise → - Exercise 12Hard
Capstone — Compose a Projection
Build the employee compensation projection required by the downstream export.
- Numeric functions
SQLite + PostgreSQL + MySQL + SQL Server live · 1 guided
Open exercise →
Attempt
Write a query or design from the brief before opening any hints.
Validate
Run it against the included dataset and inspect the output.
Explain
Compare the verified answer and explain each choice aloud.
Learn before practicing SELECT Statements
Strengthen your understanding with these targeted learning topics:
Continue practicing
Build the next SQL skill
WHERE Clause & Filtering
Practice SQL WHERE clauses with realistic boundary, NULL, text, date, exclusion, and production-filtering problems.
Basic SQL Functions
Practice production-oriented string cleanup, numeric transformations, NULL handling, tolerant conversion, and delimiter parsing.
ORDER BY & Sorting
Practice deterministic SQL ordering with tie-breakers, custom priorities, NULL placement, expressions, joined data, aggregates, and portable top-N patterns.
Open the interactive workspace and practice across SQL topics.