All Exams Test series for 1 year @ ₹349 only
Question

Consider the following two relations, named Customer and Person, in a database:
Person (
aadhaar CHAR(12) PRIMARY KEY,
name VARCHAR(32));
Customer (
name VARCHAR(32),
email VARCHAR(32) PRIMARY KEY,
phone CHAR(10),
aadhaar CHAR(12),
FOREIGN KEY (aadhaar) REFERENCES Person(aadhaar));
Which of the following statements is/are correct?

Database Relation Constraints Analysis

This solution analyzes the properties of the $Person$ and $Customer$ relations based on the provided schema definitions to determine the correctness of the given statements.

Statement Analysis

  • Statement 1 Analysis: $aadhaar$ as Candidate Key in $Customer
    The $Customer$ relation defines $email$ as the $PRIMARY KEY. Candidate keys are columns or sets of columns that uniquely identify rows and could serve as a primary key. Since $aadhaar$ is only defined as a $FOREIGN KEY and lacks a $UNIQUE or $PRIMARY KEY constraint in the $Customer$ table, it is not a candidate key. Incorrect.
  • Statement 2 Analysis: $phone$ NULLability in $Customer
    The $phone$ column in the $Customer$ relation is defined as $CHAR(10). In SQL, columns typically allow $NULL$ values by default unless a $NOT NULL constraint is explicitly applied. As there is no $NOT NULL constraint on $phone$, it can accept $NULL$ values. Correct.
  • Statement 3 Analysis: $aadhaar$ as Candidate Key in $Person
    In the $Person$ relation, $aadhaar$ is declared as the $PRIMARY KEY. By definition, a $PRIMARY KEY uniquely identifies each record and must contain unique, non-NULL values. Therefore, $aadhaar$ satisfies the criteria for a candidate key. Correct.
  • Statement 4 Analysis: $aadhaar$ NULLability in $Person
    $aadhaar$ is designated as the $PRIMARY KEY for the $Person relation. A fundamental property of a $PRIMARY KEY$ is that it cannot contain $NULL values. Hence, $aadhaar$ cannot be $NULL in the $Person relation. Incorrect.

Correct Statements Identification

The analysis identifies statements concerning the allowance of NULL values for the 'phone' field in the 'Customer' table and the status of 'aadhaar' as a candidate key in the 'Person' table as accurate based on standard SQL rules and the provided schema.

Was this answer helpful?

Important Questions from Integrity Constraints

  1. Consider two relations r and s defined on the relational schemas R(A,B) and S(E,C), respectively. A is the primary key of R and E is a foreign key of S referencing A in R.

    Which of the following operations will NEVER violate the foreign key constraint?
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App