The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+21 votes

Consider a relational table with a single record for each registered student with the following attributes:

  1. $\text {Registration_Num:}$ Unique registration number for each registered student
  2. $\text {UID:}$ Unique identity number, unique at the national level for each citizen
  3. $\text {BankAccount_Num:}$ Unique account number at the bank. A student can have multiple accounts or joint accounts. This attribute stores the primary account number.
  4. $\text {Name:}$ Name of the student
  5. $\text {Hostel_Room:}$ Room number of the hostel

Which of the following options is INCORRECT?

(A) $\text {BankAccount_Num}$ is a candidate key

(B) $\text {Registration_Num}$ can be a primary key

(C) $\text {UID}$ is a candidate key if all students are from the same country

(D) If $S$ is a super key such that $S \cap \text{UID}$ is $\text{NULL}$ then $S \cup \text{UID}$ is also a superkey

asked in Databases by Veteran (106k points) | 1.3k views
plz ans this
here CKs are Registration_Num and UID

(D) If S is a super key, let (Name,Registration_Num), such that (Name,Registration_Num)∩UID is NULL then (Name,Registration_Num)∪UID is also a superkey​​​​​​​

3 Answers

+27 votes
Best answer

A relation is given (Registration_Num, UID, BankAccount_Num, Name, Hostel_Room).

Now, Registration_Num is unique for each student. So with this, we can identify each student. Hence, this can be the primary key.

UID: It's an identification number for a person in a country. (Say you're in India and your UID is 0243. Someone in Pakistan may also have the same UID as 0243). So, if all students are from India (that is, the same country) then their UID will be different and then UID will be a Candidate key.

If S is a super key then S $\cup$ UID will be a Super key. e.g.  R(A, B, C, D), If AB is a superkey then ABC, ABCD are also superkey.

BankAccount_Num is not a candidate key, because a student can have multiple accounts or joint accounts. We can not identify each student uniquely with BankAccount_Num.

answered by Veteran (10.1k points)
selected by
Is the reason given for BankAccount_Num correct? Even if we have multiple bank accounts for a single student but we are storing only the primary account number not all.

I understood that answer is A but please clear this doubt?
@Gaurab Ghosh

what happen when two students having joint bank account ??


Consider a relational table with a single record for each registered student

Thus two banks a/c for a single registered student is not allowed. That's why we cannot make bank a/c as a candidate key.

BankAccount_Num:BankAccount_Num: Unique account number at the bank

This clearly means that a student can have two same account numbers of different bank.But at bank level,account number of a student is unique. So, BankAccount_Num cannot be a Candidate Key.

@Ayush. If two students has joint account,then the value will be same in the bankaccount_num column. It does not say unique bankacount_num for each student,like it says in registeration number

@rahul-do you mean to say that joint account in which 2 students are joint holders for one account?
Yes.It can be possible,right?

@rahul-Here nothing more is mentioned about the joint account other than its name.

So, we cannot say whether a joint account exists between two students as a joint account can exist between a student and any other person who is not a student(maybe his family member)

But yes, the important part is

BankAccNum is UNIQUE AT BANK LEVEL- means say for two banks SBI AND PNB, there may be same account number which belongs to both banks.

But say AT SBI, BANK A/c Num say 'a1', will be unique and a student can have multiple bank accounts in different banks in which case our DB can contain same account numbers.

I did not get you:( Can you give me an example where DB contain same bank number ?

A has account in SBi with account number as a1

B has account number in PND as a1

So a1 is not unique.Is this what you are trying to say?
Yeah. That is what I meant. Usually, a bank account number has bank code, branch code and some other codes depending on what the structure is dictated by the financial institution of that country.

So, here in context of question If I'm concerned, the question setter clearly wants us to focus on words

"unique at bank level"

I dont know why are you including bank level

Question says it is unique at bank.

It does not say that it has 1 account in bank X.He/she may have multiple accounts with same bank.

 the last comments i told if two student have same account number then this is not candidate key.I think that was true reasoning.Because he/say may have joint account with some other student and incase of that we cannot say bank account in unique.


@Rahul-Sorry for troubling you rahul. It's Unique at bank.

And yes two students can have a joint account together like if they are brothers and sisters or siblings, then they can share an account.

So, we cannot identify a student uniquely with bank account number.

+12 votes
Ans is A

can have possible duplicate values

As in case of joint account maybe 2 students  having joint account together.

In d) any non key attribute combined with superkey can uniquely identify all attributes.
answered by Boss (8.5k points)
why not c?

UID: Unique identity number, unique at the "National level" for each citizen.
and in option C it is clearly mentioned that "if all students are from the same country" then UID is primary key..

ok tnks
–3 votes
Option B

As a student can have two bank accounts so for this particular student the relation will contain two tuples but for these two tuples registration_num is same so it can't be a primary key..
answered by Veteran (14.1k points)
Der is single tuple bcoz Bank_Account_no stores information regarding primary bank account no only.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,732 questions
39,309 answers
36,733 users