Which SQL command is used to add new rows to a database table?
2024
Which SQL command is used to add new rows to a database table?
Answer: C. INSERT — Concept: SQL statements are grouped by what they act on. DDL (CREATE, ALTER, DROP) defines or modifies the structure of database objects — tables, columns,…
- A.
ADD
- B.
CREATE
- C.
INSERT
- D.
More than one of the above
- E.
None of the above
Attempted by 2156 students.
Show answer & explanation
Correct answer: C
Concept: SQL statements are grouped by what they act on. DDL (CREATE, ALTER, DROP) defines or modifies the structure of database objects — tables, columns, indexes. DML (INSERT, UPDATE, DELETE, SELECT) manipulates the actual data rows stored inside those structures. Adding a new row of data is a data-manipulation task, so it needs a DML command, specifically INSERT, which takes the form INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
Application: The question asks for the command that adds new rows to a table, i.e. inserts data. Matching each offered command against the DDL/DML split above:
ADD is a keyword used with ALTER TABLE to add a new COLUMN to an existing table's structure (ALTER TABLE table_name ADD column_name datatype;) — a DDL action on structure, not on rows.
CREATE builds a brand-new table or other object (CREATE TABLE table_name (...);) — also DDL, and it produces an empty structure with zero rows, not new rows in an existing table.
INSERT is the DML command whose entire purpose is to add one or more new rows of data into an existing table, via INSERT INTO ... VALUES ...
Cross-check: Since exactly one command (INSERT) performs the row-adding action, "More than one of the above" is ruled out, and since that one command does exist among the options, "None of the above" is ruled out too. This confirms INSERT is the unique, correct answer.