IF I have multiple candidate keys which one is a primary key and justify your choice ??

Posted by zahrani on Stack Overflow See other posts from Stack Overflow or by zahrani
Published on 2010-05-28T02:12:07Z Indexed on 2010/05/28 2:21 UTC
Read the original article Hit count: 228

Filed under:

Given R = { Account , Analyst , Assets, Broker, Client, Commission, Company, Dividend, Exchange, Investment, Office, Profile, Return, Risk_profile, Stock, Volume} and a set of functional dependencies F{fd1, fd2,fd3, fd4, fd5,fd6, fd7, fd8, fd9, fd10, fd11} where:

fd1: Client -> Office fd2: Stock -> Exchange, Dividend fd3: Broker -> Profile fd4: Company -> Stock fd5: Client -> Risk_profile, Analyst fd6: Analyst -> Broker fd7: Stock, Broker -> Invenstment, Volume fd8: Stock -> Company fd9: Investment,Commission -> Return fd10: Stock, Broker -> Client fd11: Account -> Assests

these are candidate key(s) :

(Account, Commission,Analyst ,Company) (Account, Commission,Analyst ,Stock) (Account ,Commission,Broker ,Company) (Account ,Commission,Broker ,Stock) (Account ,Commission,Client, Company) (Account ,Commission,Client ,Stock)

(Q) Select a primary key and justify your choice ?

I was select (Account ,Commission,Broker ,Stock) as a primary key ???

I chose that because it has the most direct dependencies compared to other ones. e.g. more attributes are functionally dependent on this primary key.

please check if my answer is it true ? or Not

I'm waiting your answer asap

thank you

© Stack Overflow or respective owner

Related posts about database