Consider the relation Emp–Dept with SSN as key. Which of the following…
2018
Consider the relation Emp–Dept with SSN as key.

Which of the following operation(s) is/are invalid?
Answer: D. Inserting an employee without SSN — Concept: Entity integrity is a core relational-model rule -- in every relation, the attribute(s) forming the primary key must be present and unique for every…
- A.
Inserting an employee without name and address
- B.
Inserting an employee with only SSN
- C.
Inserting a department with no employee
- D.
Inserting an employee without SSN
Attempted by 2243 students.
Show answer & explanation
Correct answer: D
Concept: Entity integrity is a core relational-model rule -- in every relation, the attribute(s) forming the primary key must be present and unique for every tuple, because the primary key is precisely what lets the DBMS distinguish one tuple from another. Any other, non-key attribute is free to hold a NULL value for a given tuple unless the schema separately declares a NOT NULL or foreign-key constraint on it.
Application: In Emp–Dept, SSN is the sole primary key (the underlined attribute in the schema); Ename, EAddr, Dept. No., Dept. Name, and Dept. Manager are all non-key attributes. Checking each operation against this rule:
Inserting an employee without name and address -- Ename and EAddr are non-key attributes, so leaving them NULL does not violate entity integrity; the operation is valid as long as SSN itself is supplied.
Inserting an employee with only SSN -- the required primary-key attribute is present, and every other attribute may be left NULL; the operation is valid.
Inserting a department with no employee -- the department-related attributes (Dept. No., Dept. Name, Dept. Manager) are themselves non-key attributes of this single merged relation, so a tuple can be entered with those fields unfilled as long as its SSN is supplied; the operation is valid.
Inserting an employee without SSN -- SSN is the primary key of the relation, and entity integrity requires a primary key to be non-NULL and present for every tuple; leaving it out makes the tuple impossible to insert, so the operation is invalid.
Cross-check: Of the seven attributes in Emp–Dept, SSN is the only one carrying the underline that marks a primary key in the schema diagram. Every other attribute -- whether it names, addresses, or otherwise describes the employee, or records the department's number, name, or manager -- is non-key, so it is the presence or absence of an SSN value, not any other field, that decides validity. Only the operation that omits SSN is therefore invalid.
A video solution is available for this question — log in and enroll to watch it.