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.
To retrieve all columns from the table 'employees', you would use the _____ command.
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.
To add a new row into the 'products' table, you would use the _____ statement.
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.
To change the price of a product in the 'inventory' table, you would use the _____ statement.
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.
To remove specific rows from the 'orders' table, the _____ statement should be used.
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.
To create a new table named 'clients', you would start with the _____ statement.
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.