sql · level 1 · unit 1 · lesson 2
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
SELECT * FROM pets; means show me everything in pets.
The questions you write are in , a language made for talking to databases. A question written in SQL is called a . Here is the most useful one there is.
SELECT and FROM are keywords: words with a special job. SELECT means show me. The star * means every column. FROM pets names the table to look in.
The ; finishes the query, like a full stop. The answer comes back as a grid, with the column names on the top line and a | between columns.
SELECT * FROM pets; SQL does not mind if you type select in small letters, but capitals make keywords stand out.
guess first
A new table. What will this query show?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
SELECT * FROM snacks;
your turn
Your turn. Peek inside the films table.
There is a table called films. Fill in both blanks so the query shows every column of it, then press run.
result
Your answer appears here as a table.
fix it
This query is missing a word. Can you fix it?
result
Your answer appears here as a table.
- Read the query out loud. Show me every column of... which table, and how do you say so?
- The database needs the keyword
FROMbefore the table name. - Type FROM between the star and pets, then press run.
nailed it
you wrote your first sql query. :D
- A query is a question written in SQL.
SELECT * FROM pets;shows every row and column of pets.- End every query with a semicolon.
new words in your collection
- SQL
- query
- keyword
- semicolon
This lesson isn’t saved. A free account remembers every lesson you finish.