How Well Do You Really Know SQL? Quiz

Challenge your knowledge of key SQL commands with this fill-in-the-blank quiz designed for beginners learning SQL database systems.

  1. Selecting Data

    To retrieve all columns from a table named 'students', fill in the blank: SELECT ___ FROM students;

    1. SHOW
    2. *
    3. ALL
    4. COLUMNS

    Explanation: The asterisk (*) is the correct wildcard symbol used in SQL to select all columns from a table. 'ALL' and 'COLUMNS' are not valid SQL syntax, and 'SHOW' is not used for selecting data in this context.

  2. Inserting Records

    To add a new row into a table named 'orders', which SQL command correctly fills the blank: ___ INTO orders (id, total) VALUES (1, 100);

    1. PUT
    2. APPEND
    3. ADD
    4. INSERT

    Explanation: 'INSERT' is the correct command in SQL to add new records to a table. 'ADD', 'APPEND', and 'PUT' are not valid SQL keywords for inserting data.

  3. Updating Data

    To change a column value in a 'products' table, which command completes this: ___ products SET price = 9.99 WHERE id = 5;

    1. CHANGE
    2. MODIFY
    3. UPDATE
    4. ALTER

    Explanation: 'UPDATE' is used to modify existing table records. 'CHANGE' and 'MODIFY' are not standalone SQL commands for this action, while 'ALTER' is primarily used for changing table structure, not row data.

  4. Removing Records

    To delete all rows from the 'sessions' table, what fills in the blank: ___ FROM sessions;

    1. CLEAR
    2. DROP
    3. DELETE
    4. REMOVE

    Explanation: 'DELETE' removes rows from a table but keeps the table structure. 'REMOVE' and 'CLEAR' are not valid SQL commands, and 'DROP' deletes the table structure entirely, not just its data.

  5. Creating Tables

    What command creates a new table, as in: ___ TABLE employees (id INT, name VARCHAR(100));

    1. MAKE
    2. CREATE
    3. FORM
    4. BUILD

    Explanation: 'CREATE' is the SQL command for generating a new table. 'MAKE', 'BUILD', and 'FORM' are not valid ways to create tables in SQL, making 'CREATE' the only correct choice.