Entity integrity rule in the relational model: Which statement correctly expresses the entity integrity constraint for primary keys?

Database Logical Database Design Difficulty: Easy
Choose an option
  • A
    no primary key attribute may be null.
  • B
    no primary key can be composite.
  • C
    no primary key may be unique.
  • D
    no primary key may be equal to a value in a foreign key.

Answer

Correct Answer: no primary key attribute may be null.

Explanation

Introduction / Context:Entity integrity is a foundational rule in relational databases that ensures each row represents a real, uniquely identifiable entity instance. It specifies how primary keys must behave to guarantee unambiguous identification.

Given Data / Assumptions:

  • Every table has a designated primary key.
  • Primary keys are used as targets for foreign keys from other tables.
  • Null represents the absence of a value and cannot identify a row.

Concept / Approach:

The entity integrity rule states that a primary key must be unique and contain no null values. Nulls would imply “unknown” or “not applicable,” which violates the identity requirement of the key. Composite primary keys are allowed; uniqueness is essential, not single-column status.

Step-by-Step Solution:

Define PK attributes as NOT NULL.Enforce uniqueness on the PK (single or composite).Use FK constraints in child tables to reference the PK.

Verification / Alternative check:

Attempt to insert a row with a NULL in any PK component; the DBMS should reject it. Check that duplicate PK values are also rejected.

Why Other Options Are Wrong:

“No composite PK”: false—composite keys are valid.

“No PK may be unique”: false—the PK must be unique.

“PK may not equal FK values”: FKs commonly equal PK values; that is the point of referencing.

Common Pitfalls:

Misusing nullable surrogate keys; allowing NULLs in parts of composite keys; failing to index PKs for performance.

Final Answer:

no primary key attribute may be null.

Discussion & Comments
No comments yet. Be the first to comment!
Join Discussion