← All courses
Beginner5 lessons + 3 bonus

SQL Fundamentals

Write your first real queries — pick columns, filter rows, sort results, and limit output. The four moves you will use in every query you ever write.

Start course free →

Fast SQL learning loop

  • Read the prompt and schema before writing.
  • Run early and often to validate each clause.
  • Compare expected output shape, not just syntax validity.

Professional learning blueprint

Build absolute SQL fluency with clean SELECT logic and deterministic outputs.

Outcomes

  • Read table structure confidently and select only relevant columns.
  • Write predictable, reproducible queries with explicit sorting.
  • Adopt clean SQL formatting and aliasing habits from day one.

Real-world use

  • Business analysts creating baseline reporting datasets.
  • Data interns preparing quality-controlled extracts.
  • Engineers validating raw application data quickly.

Fast study plan

  1. 1. Finish lessons in order, then repeat the hardest two exercises immediately.
  2. 2. After each lesson, rewrite one query from memory without looking.
  3. 3. Use playground challenges daily for 10-15 minutes to lock in syntax.

Deep learning journey

Foundations Mastery Arc

Build deterministic query habits and clean output structure before adding complexity.

Query structure basics

Understand clause order and readable query flow.

  • SELECT column targeting
  • FROM table intent
  • ORDER BY deterministic output

Result-shape control

Return exactly what business stakeholders need.

  • Aliasing conventions
  • LIMIT/OFFSET safety
  • Distinct output checks

Output quality habits

Guarantee reproducible, review-friendly result sets.

  • Stable tie-breaking
  • Null visibility
  • Naming for dashboards

Bonus lesson units

Additional lessons to master this track (3)

1. Type casting and data conversion

Cast values with :: and CAST() — integer, numeric, text, date, and boolean conversions.

2. String manipulation functions

Use UPPER, LOWER, CONCAT, SUBSTRING, TRIM, REPLACE, and SPLIT_PART for data cleaning.

3. Arithmetic and math functions

Apply ROUND, FLOOR, CEIL, ABS, POWER, and SQRT to build computed columns in reports.

Expanded practice

Mission exercises (10)

Open playground →

1. Executive employee list

easy

Return first_name, last_name, salary from employees with explicit ORDER BY and LIMIT 20.

2. Column precision drill

easy

Return exactly 4 requested columns from employees and rename two with business aliases.

3. Deterministic top earners

medium

Return top 15 salaries with tie-break order by employee_id.

4. Unique department list

easy

Return distinct department_id values sorted ascending.

5. Clean contact extract

medium

Return employee contact columns and normalize output column names with aliases.

6. Reproducible paging

medium

Return rows 21-40 using LIMIT/OFFSET with stable ordering.

7. Salary band snapshot

medium

Return employees with salary, plus a derived salary_band CASE expression.

8. QA preview view

easy

Build a compact preview query that verifies table shape and data quality.

9. Sort audit

hard

Demonstrate two different deterministic ordering strategies and compare outputs.

10. Readable SQL rewrite

medium

Refactor a messy SELECT into clean formatting with clear aliases.

Study references

What to study next

Learn to read data from a database — the skill everything else in SQL builds on. By the end you will know how to write any single-table query with confidence.

What you'll learn

  • SELECT specific columns (or * for all)
  • Filter rows with WHERE and comparison operators (=, <>, <, >, BETWEEN)
  • Sort results with ORDER BY — ascending and descending
  • Limit output with LIMIT and skip rows with OFFSET
  • Remove duplicate rows with DISTINCT
  • Rename columns and expressions with AS

What you'll practice on

All exercises run against the HR database — a company with employees, departments, jobs, and salary history. You'll answer questions like "list the five highest-paid employees" and "find everyone hired before 2010."

Prerequisites

None. This is the starting point — no SQL experience required.

Lessons · 5 total