Introduction to SQL

A database stores data in tables — think of a table like a spreadsheet, with rows and columns. SQL is the language used to read and change that data.

The demo table

Most examples in this course use a small employees table with columns for id, name, department, and salary. Click "Run query" to see everything in it:

select all rows
Result

Selecting specific columns

Instead of * (everything), you can name exactly which columns you want:

select specific columns
Result
Note: SQL keywords like SELECT and FROM are traditionally written in uppercase to make queries easier to read, but SQL itself doesn't require it.