CBSE Class 12 Informatics Practices Question 3 of 79

MySQL SQL Revision Tour — Question 3

Back to all questions
3
Question

Question 3

Assertion. The INSERT INTO statement can skip some columns' values.

Reason. Only the columns allowing the NULL values or have default-value-defined, can be skipped in INSERT INTO statement of SQL.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

Both A and R are true and R is the correct explanation of A.

Explanation
The INSERT INTO statement allows skipping columns values for columns that permit NULL values or have default values defined. If any other column (that does not have a default value and is defined as NOT NULL) is skipped or omitted, an error message is generated, and the row is not added.