Prepstellar

SQL Fundamentals · Practice set 2 of 5

Database Structure and Core Vocabulary: 10 practice questions

10 questions · Untimed · Free

10 free SQL Fundamentals practice questions on Database Structure and Core Vocabulary, with an explanation for every answer. Untimed. The full mock exam and the timed version are in the app.

Set 2 · Database Structure and Core Vocabulary · 10 questions Read the lesson
  1. Question 1 of 10

    Which query returns only the name column of the artists table?

    1. ASELECT name, artist_id FROM artists;
    2. BSELECT artists FROM name;
    3. CFROM artists SELECT name;
    4. DSELECT name FROM artists;
    Show the answer

    The column comes first and the table second, so the column goes after SELECT and the table after FROM.

    Next → 1 / 10
  2. Question 2 of 10

    The composer box of Balls to the Wall is empty. What does SELECT name, composer FROM tracks; show for that song?

    1. AAn error, because one box has no value
    2. BThe song, with the number zero
    3. CNothing, because that song is left out
    4. DThe song, with a null box beside it
    Show the answer

    The row stays in the result and the song is shown; only that one box is null, which means the value is missing.

    Next → 2 / 10
  3. Question 3 of 10

    A query on albums asks for artist_id first and title second. What does the result show?

    1. AThe titles first, because they are text
    2. BThe titles first, as the table stores them
    3. CThe id numbers, then the titles
    4. DOne column only, since one has to come first
    Show the answer

    The columns come back in the order the query wrote them, so the id column is shown before the title column.

    Next → 3 / 10
  4. Question 4 of 10

    You want to know how long each song lasts. Which table do you read?

    1. AAny of the three tables
    2. BThe albums table
    3. CThe artists table
    4. DThe tracks table
    Show the answer

    How long a song lasts is stored in the milliseconds column, and that column lives in the tracks table.

    Next → 4 / 10
  5. Question 5 of 10

    Running SELECT name, milliseconds FROM artists; gives an error. What is the fix?

    1. AAdd a data type to the column
    2. BAsk for the two columns in the other order
    3. CWrite the name column twice
    4. DRead the tracks table instead
    Show the answer

    That table has no milliseconds column, and the table that does hold song lengths is the tracks table.

    Next → 5 / 10
  6. Keep the ones you got wrong

    In the app, every question you miss comes back exactly when you’re about to forget it.

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store
  7. Question 6 of 10

    One day a second artist is stored with the same text in name as an older one. Why can the store still tell them apart?

    1. AThe store refuses the second artist
    2. BTheir key values are different
    3. CThe two rows are told apart by position
    4. DThe second artist goes in another table
    Show the answer

    Two artists may share the same text, but each row keeps its own key value, and that value points at one row.

    Next → 6 / 10
  8. Question 7 of 10

    The albums row with album_id 5 stores artist_id 3. How do you find out who made that album?

    1. ARead the third row shown in the artists table
    2. BCount the rows of artists as far as number 3
    3. CRead the artists row whose artist_id is 3
    4. DRead the albums row whose album_id is 3
    Show the answer

    The album stores the key of its artist, so you look in the artists table for the row whose key value is 3.

    Next → 7 / 10
  9. Question 8 of 10

    The albums table has six rows and three columns. What does SELECT title FROM albums; return?

    1. AOne row with six columns
    2. BOne row holding the number six
    3. CSix rows with three columns
    4. DSix rows with one column
    Show the answer

    Asking for fewer columns never removes a row, so the six albums come back with the one column you named.

    Next → 8 / 10
  10. Question 9 of 10

    The artists table stores artist 4 as Alanis Morissette. What does SELECT name FROM artists; return for that row?

    1. ABoth the number 4 and the text
    2. BNothing, because the id is not named
    3. CAlanis Morissette, with no id number
    4. DThe number 4, with no text
    Show the answer

    The query names one column, so that row comes back with that box alone: the text of the artist and nothing else.

    Next → 9 / 10
  11. Question 10 of 10

    Row 5 of albums is album_id 5, title Big Ones, artist_id 3. Which box of that row holds text?

    1. AAll three boxes, since a row is text
    2. BThe title box, holding Big Ones
    3. CThe artist_id box, holding 3
    4. DThe album_id box, holding 5
    Show the answer

    The title column stores text, so its box holds the words Big Ones, while the other two columns of the row store whole numbers.

    Next → 10 / 10
  12. You’ve finished this set

    That’s 10 questions on Database Structure and Core Vocabulary. In the app the ones you miss come back exactly when you’re about to forget them.

    Back to the course Next lesson: A SQL Workflow from Question to Result

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store

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

On your phone, with the same account

Get it on Google Play Download on the App Store

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review