Can the primary keys in database be multi-valued ? For eg if the student has multiple bank accounts numbers can we we use this attribute as key ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is an interesting question since the two bank accounts would both be unique to the user and wouldn’t be duplicated by any other row as per the definition given in Cthulhu’s answer.
However, since you are effectively defining a one-to-many relationship between the student and the bank account, you are establishing the bank account as a separate entity rather than an attribute of the student entity. Therefore you really need to look for a separate unique identifier for the student to use as the primary key.
At best, in this case, you could use the student’s ‘primary’ bank account as the primary key and have another field for alternative bank account which has nothing to do with the key.