Bird
0
0

Which of the following statements correctly defines a column email that cannot be NULL?

easy📝 Conceptual Q2 of 15
SQL - Table Constraints

Which of the following statements correctly defines a column email that cannot be NULL?

A<code>email VARCHAR(100) NULL</code>
B<code>email VARCHAR(100) NOT NULL</code>
C<code>email VARCHAR(100) DEFAULT NULL</code>
D<code>email VARCHAR(100) ALLOW NULL</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify the syntax for NOT NULL

    The correct syntax to prevent NULLs is adding NOT NULL after the data type.
  2. Step 2: Check each option

    Only email VARCHAR(100) NOT NULL uses NOT NULL correctly; others allow NULL or use invalid keywords.
  3. Final Answer:

    email VARCHAR(100) NOT NULL -> Option B
  4. Quick Check:

    Correct syntax for NOT NULL is NOT NULL [OK]
Quick Trick: Use NOT NULL keyword after data type [OK]
Common Mistakes:
MISTAKES
  • Using NULL or DEFAULT NULL to prevent NULLs
  • Writing ALLOW NULL which is invalid
  • Confusing DEFAULT NULL with NOT NULL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes