Essential SQL Commands: Fill-in-the-Blank Quiz Quiz

Challenge your foundational knowledge of SQL commands in relational database systems with these fill-in-the-blank questions. Each item tests a key SQL operation or concept in an easy format.

  1. Basic Data Retrieval

    To retrieve all columns from the table 'employees', you would use the _____ command.

    1. DROP
    2. INSERT
    3. SELECT
    4. UPDATE

    Explanation: SELECT is the command used to retrieve data from a database table. INSERT is used to add new records, UPDATE modifies existing data, and DROP deletes entire tables, making them incorrect choices for data retrieval.

  2. Adding New Data

    To add a new row into the 'products' table, you would use the _____ statement.

    1. MERGE
    2. INSERT
    3. DELETE
    4. ALTER

    Explanation: INSERT is used for adding new records to a table. ALTER changes table structure, DELETE removes data, and MERGE is for combining data from two tables, none of which add a new row directly.

  3. Changing Existing Data

    To change the price of a product in the 'inventory' table, you would use the _____ statement.

    1. UPDATE
    2. TRUNCATE
    3. CREATE
    4. SELECT

    Explanation: UPDATE modifies existing records in a table. TRUNCATE removes all rows, CREATE is for new tables or databases, and SELECT only retrieves data, not modify it.

  4. Removing Data

    To remove specific rows from the 'orders' table, the _____ statement should be used.

    1. RENAME
    2. DESCRIBE
    3. DROP
    4. DELETE

    Explanation: DELETE is used to remove specific records in a table. DROP deletes entire tables, RENAME changes table names, and DESCRIBE shows table structure without deleting data.

  5. Table Creation

    To create a new table named 'clients', you would start with the _____ statement.

    1. CREATE
    2. SELECT
    3. GRANT
    4. COMMIT

    Explanation: CREATE is the command for making new tables or databases. GRANT gives permissions, SELECT retrieves data, and COMMIT saves transaction changes, but does not create tables.