Question:

Consider the following database schema: \[ \text{Person (aadhar CHAR(12) PK, name VARCHAR(32))} \] \[ \text{Customer (name VARCHAR(32), email VARCHAR(32) PK, phone CHAR, aadhar CHAR(12) FK(aadhar))} \] Which of the following statements is/are correct?

Show Hint

Primary Keys (PK) must be unique and non-null, while Foreign Keys (FK) establish relationships but do not enforce uniqueness.
Updated On: Feb 15, 2025
  • Aadhar is the candidate key (CK) of Person
  • Phone number can be NULL in Customer
  • Aadhar can be NULL in Person
  • Aadhar is the candidate key in Customer
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

1. Aadhar as CK of Person:
- The attribute `aadhar` in `Person` is declared as the Primary Key (PK). - A primary key uniquely identifies each record, making `aadhar` a candidate key in `Person`.
- This statement is correct.
2. Phone number can be NULL in Customer:
- There is no explicit constraint enforcing `NOT NULL` on `phone` in `Customer`.
- By default, attributes without `NOT NULL` constraints can hold `NULL` values.
- This statement is correct.
3. Aadhar can be NULL in Person:
- The attribute `aadhar` in `Person` is defined as a Primary Key (PK). - A Primary Key cannot be NULL by definition.
- This statement is incorrect.
4. Aadhar is CK in Customer:
- `aadhar` in `Customer` is a Foreign Key (FK) referencing `Person(aadhar)`, not a Candidate Key.
- The Primary Key (PK) of `Customer` is `email`, so `aadhar` does not qualify as a CK.
- This statement is incorrect.
Conclusion: The correct answer is (1) Aadhar is the candidate key of Person.
Was this answer helpful?
0
0