Lesson 1 of 10 Β· 12 min Β· 1 hands-on step
Tables & SELECT Queries
Read data with SELECT, filter it with WHERE and sort it with ORDER BY.
What is a database?
A relational database stores data in tables, like spreadsheets with strict rules. Each row is a record (one employee), and each column is a field (name, salary). Most web apps you'll work on use one: PostgreSQL, MySQL or SQLite.
Reading data
Filtering
Sorting and limiting
SQL keywords aren't case sensitive, but writing them in UPPERCASE is the convention and makes queries easier to scan.
The exercise runs a real SQLite database in your browser, and the test compares your result with the expected rows.
π§ͺ Practice
The employees table has columns id, name, department_id, salary, hired.
Return the name and salary of every employee earning more than 90000, highest salary first.
Output appears here. Press Run or Ctrl/β + Enter.
β Check your understanding
Which clause filters rows?
What is a primary key?
Create a free account to track your progress.