Bird
0
0

Which of the following is the correct syntax to add a NOT NULL constraint to a column named email when creating a table?

easy📝 Syntax Q12 of 15
SQL - Table Constraints

Which of the following is the correct syntax to add a NOT NULL constraint to a column named email when creating a table?

CREATE TABLE users (
id INT PRIMARY KEY,
email ???
);
ANULL VARCHAR(255)
BNOT NULL VARCHAR(255)
CVARCHAR(255) NULL
DVARCHAR(255) NOT NULL
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct order of column definition

    The data type comes first, then constraints like NOT NULL.
  2. Step 2: Check each option's order

    VARCHAR(255) NOT NULL correctly places VARCHAR(255) before NOT NULL; others have wrong order or use NULL instead.
  3. Final Answer:

    VARCHAR(255) NOT NULL -> Option D
  4. Quick Check:

    Data type first, then NOT NULL [OK]
Quick Trick: Data type comes before NOT NULL in column definition [OK]
Common Mistakes:
MISTAKES
  • Writing NOT NULL before data type
  • Using NULL instead of NOT NULL
  • Omitting data type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes