Questions: SQL: INSERT, UPDATE, and DELETE (DML)

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A developer runs: UPDATE employees SET salary = 75000; What happens?

AOnly employees with NULL salaries are updated, since those are the unset rows
BThe statement fails with an error because a WHERE clause is required for UPDATE
CEvery row in the employees table has its salary set to 75000
DOnly the most recently inserted employee row is updated
Question 2 Multiple Choice

Why should INSERT statements always list column names explicitly rather than relying on positional order?

AListing column names is required by the SQL standard; positional inserts are not valid syntax
BPositional inserts are significantly slower because the database must scan the full schema
CIf the table is later altered — columns added, reordered, or removed — positional inserts may silently insert values into the wrong columns
DColumn name lists enable constraint checking; positional inserts bypass NOT NULL validation
Question 3 True / False

A DELETE statement without a WHERE clause will fail with an error, because SQL requires you to specify which rows to delete.

TTrue
FFalse
Question 4 True / False

If you attempt to INSERT a row that violates a NOT NULL or FOREIGN KEY constraint, the database will reject the insert rather than storing invalid data.

TTrue
FFalse
Question 5 Short Answer

What is the purpose of wrapping UPDATE or DELETE statements in a transaction, and when would you use ROLLBACK?

Think about your answer, then reveal below.