Challenge your knowledge of key SQL commands with this fill-in-the-blank quiz designed for beginners learning SQL database systems.
To retrieve all columns from a table named 'students', fill in the blank: SELECT ___ FROM students;
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.
To add a new row into a table named 'orders', which SQL command correctly fills the blank: ___ INTO orders (id, total) VALUES (1, 100);
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.
To change a column value in a 'products' table, which command completes this: ___ products SET price = 9.99 WHERE id = 5;
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.
To delete all rows from the 'sessions' table, what fills in the blank: ___ FROM sessions;
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.
What command creates a new table, as in: ___ TABLE employees (id INT, name VARCHAR(100));
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.