SQL Fundamentals · Getting started
14 cards
Database Structure and Core Vocabulary
-
Quick check
What comes back from SELECT artist_id FROM artists;
AThe five id numbers, one per row
Right. The query keeps every row and shows only the column you named.
BOne row holding the number 5
The query does not count rows; it shows the value stored in each row.
CThe five artist names
That is the result of asking for the other column of the table.
2 / 14
-
Quick check
Which columns come back from SELECT artist_id, title FROM albums;
AOnly the id numbers
Both columns are named in the query, so both come back.
BThe titles, then the ids
The query names the id column first, so it is shown first.
CThe ids, and then the titles
Right. The columns are shown in the order the query wrote them.
4 / 14
-
Quick check
What happens when you run SELECT name, milliseconds FROM artists;
AThe song lengths of every artist come back
Song lengths are not stored in that table at all.
BIt fails: that table has no such column
Right. A column name works only in the table that has it.
CEmpty boxes come back for that column
A name that does not exist is an error, not an empty box.
6 / 14
-
Keep your progress in the app
That’s 3 of 7 quick checks. In the app they stay answered, and every lesson remembers where you left off.
Keep reading hereOpens in your browser. Nothing to install.
Start studying -
Quick check
The composer box of Balls to the Wall is empty. What does the query return for that song?
AThe row is left out of the result
A missing value does not remove the row from the result.
BThe number zero in that box
A null box is not the number zero.
CThe song, and a null box
Right. The row comes back, and the one missing box is null.
8 / 14
-
Quick check
Why does the store point at an artist by artist_id and not by name?
ABecause a key value points at one row
Right. The key value belongs to one row and no other.
BBecause numbers are shorter to store
Size is not the reason; two artists could still share the same text.
CBecause the rows are sorted by that column
The stored rows are not sorted by the key, and sorting would not tell two rows apart.
10 / 14
-
Quick check
Album 6 stores artist_id 4. Which artist made that album?
AAccept
Accept is the artist whose key value is 2.
BAlanis Morissette
Right. You look in the artists table for the row with that key value.
CNobody: the value is null
The value 4 is stored, so nothing here is missing.
12 / 14
-
Quick check
Which query shows how long each song lasts?
ASELECT milliseconds FROM albums;
The albums table has no column with song lengths.
BSELECT length FROM tracks;
There is no column with that name in the table.
CSELECT milliseconds FROM tracks;
Right. The column is in the table that holds the songs.
14 / 14
-
7 quick checks · then the test
In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.
Take this lesson’s test → Next lesson: A SQL Workflow from Question to ResultOpens in your browser. Nothing to install.
Start studying
The whole course, on your computer and your phone
Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.
Opens in your browser. Nothing to install.
Start studying“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”
