SQL Topic collection
SELECT Statements SQL Topic exercises
Select columns, filter rows, remove duplicates, and order query results.
- Published pages
- 23
- Runnable now
- 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. Read-only solution guides and advanced guided labs state their capability before you choose the next action.
- 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 → - Exercise 13Easy
SELECT with WHERE Clause
Return employees who earn more than $80,000.
- Filtering
Read-only solution guide
Read solution guide → - Exercise 14Easy
SELECT with ORDER BY
Return employees ordered by salary descending.
- Sorting
Read-only solution guide
Read solution guide → - Exercise 15Easy
SELECT with LIMIT
Return the top 3 highest-paid employees.
- Sorting
- Top-N
Read-only solution guide
Read solution guide → - Exercise 16Easy
SELECT with String Functions
Return employee first and last names in uppercase format.
- String functions
Read-only solution guide
Read solution guide → - Exercise 17Easy
SELECT with Multiple Conditions
Return employees in department 10 with salary between 60000 and 90000.
- Filtering
Read-only solution guide
Read solution guide → - Exercise 18Easy
SELECT with LIKE Pattern
Return employees whose first name starts with J or G.
- Filtering
Read-only solution guide
Read solution guide → - Exercise 19Easy
SELECT with IN Operator
Return employees in departments 10, 20, or 30.
- Filtering
Read-only solution guide
Read solution guide → - Exercise 20Easy
SELECT with NULL Handling
Return employees who do not have a manager.
- NULL handling
- Filtering
Read-only solution guide
Read solution guide → - Exercise 21Medium
SELECT with CASE Statement
Classify each employee as High, Medium, or Low salary based on salary level.
- CASE expressions
Read-only solution guide
Read solution guide → - Exercise 22Medium
SELECT with String Concatenation
Return full_name and email for each employee.
- Sorting
Read-only solution guide
Read solution guide → - Exercise 23Medium
Boolean Expression in SELECT
Return first_name, salary, and is_senior as 1 when salary is above 80000, otherwise 0.
- CASE expressions
Read-only solution guide
Read solution guide →
Attempt
Write a query or design from the brief before opening any hints.
Validate
Run active exercises; use the published evidence and declared validation standard for read-only or guided pages.
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.