Multiple choice technology databases

You need to enforce these two business rules: 1. No two rows of a table can have duplicate values in the specified column. 2. A column cannot contain null values. Which type of constraint ensure that both of the above rules are true ?

  1. Check

  2. Unique

  3. Not Null

  4. Primary Key

  5. Foreign Key

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A PRIMARY KEY constraint uniquely identifies each row AND implicitly enforces NOT NULL, satisfying both rules. UNIQUE allows nulls, CHECK doesn't enforce uniqueness, NOT NULL doesn't enforce uniqueness, and FOREIGN KEY references other tables.

AI explanation

A Primary Key constraint enforces both uniqueness (no duplicate values across rows) and a NOT NULL requirement simultaneously, which is exactly the combination of the two rules described. A Unique constraint alone would still allow nulls, and a Not Null constraint alone wouldn't prevent duplicates, so neither alone satisfies both rules.