Which SQL statement adds a new row to a table?

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

Which SQL statement adds a new row to a table?

Explanation:
Adding a new row to a table is done with the INSERT INTO statement. It specifies the table and the values for the new row. For example, INSERT INTO employees (id, name, salary) VALUES (1, 'Alex', 50000); creates one new record. You can insert several rows at once with multiple value tuples: INSERT INTO employees (id, name, salary) VALUES (2, 'Sam', 45000), (3, 'Jamie', 52000); There are also ways to insert from another table with INSERT INTO ... SELECT. Other statements serve different purposes: DELETE FROM removes existing rows; ALTER TABLE changes the table structure (like adding or renaming columns, changing data types); and WHERE is a clause used to filter which rows are affected or returned by other statements.

Adding a new row to a table is done with the INSERT INTO statement. It specifies the table and the values for the new row. For example, INSERT INTO employees (id, name, salary) VALUES (1, 'Alex', 50000); creates one new record. You can insert several rows at once with multiple value tuples: INSERT INTO employees (id, name, salary) VALUES (2, 'Sam', 45000), (3, 'Jamie', 52000); There are also ways to insert from another table with INSERT INTO ... SELECT.

Other statements serve different purposes: DELETE FROM removes existing rows; ALTER TABLE changes the table structure (like adding or renaming columns, changing data types); and WHERE is a clause used to filter which rows are affected or returned by other statements.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy