The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+24 votes
2.1k views

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?

  1. $\text {BankAccount_Num}$ is a candidate key
  2. $\text {Registration_Num}$ can be a primary key
  3. $\text {UID}$ is a candidate key if all students are from the same country
  4. 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 (107k points)
edited by | 2.1k views
+1
plz ans this
+1
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

+31 votes
Best answer

Answer is (A)

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 Boss (10.3k points)
edited by
0
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?
+5
@Gaurab Ghosh

what happen when two students having joint bank account ??
+1

@Gaurab 

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.

+2

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.

0

@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

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

@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.

0
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?
0
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"
0

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.

0

@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.

0

@Ayush Upadhyaya @rahul sharma 5 If we think in this way for option A that a CK is one when given in a query fetch a unique record. If suppose Ayush has bank account number 101 , 102 , 108 if we use this in query, output will be tuple of Ayush only so this doesn't violate the condition. But if ayush and rahul have joint account number 110, if we use this in query to search, it will not fetch unique tuple instead will give 2 tuples which violates the condition of CK. Hence A should be the options because of joint account ONLY.

 

correct me if I am wrong.

+13 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 Loyal (8.1k points)
0
why not c?
+5

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..
true.

0
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 Boss (14.4k points)
+2
Der is single tuple bcoz Bank_Account_no stores information regarding primary bank account no only.
Answer:

Related questions



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

42,700 questions
48,662 answers
156,617 comments
63,971 users