1 Replies - 1112 Views - Last Post: 24 September 2010 - 08:14 PM Rate Topic: -----

#1 Guest_steve*


Reputation:

superkeys, and all of the different keys

Posted 24 September 2010 - 08:11 PM

Design and populate a relation, with a cardinality of 10 and a degree of 7 describing a collection of vehicles, boats, houses, etc (use your imagination). Identify all superkeys, all candidate keys, and select a suitable primary key. Provide rationale for your choice of primary key. Identify potential foreign keys and give your rationale.

Car insurance table
licenceNo yr_insured yr_insuredExpired model color auto/man owner
111-aaa 1999 2009 beatle pink auto Johnson
222-bbb 1999 2009 mustang white auto Trot
333-ccc 2000 2010 tacoma blue auto White
444-ddd 2007 2017 f-350 blue auto Black
555-eee 2005 2015 d-2500 black auto Smith
666-fff 2007 2017 corolla white man Lee
777-ggg 2010 2020 matrix white auto Kim
888-hhh 2008 2018 civic green man Singh
999-iii 2008 2018 escalde black auto Williams
000-jjj 2009 2019 civic red auto Vanderhoot

A Primary key would be the licenceNo.
Superkeys would include (Owner,licenceNo),and ( Owner, licenceNo,model), (Owner,licenceNo,Model,color).
A candidate key could be LicenceNo and owner.
A foreign key could be owner because an owner could have insurance for other things such as home insurance. Model could also be a foreign key because it could identify a table which shows insurance rates for certain vehicles.


Did i choose the correct keys?

Is This A Good Question/Topic? 0

Replies To: superkeys, and all of the different keys

#2 Guest_steve*


Reputation:

Re: superkeys, and all of the different keys

Posted 24 September 2010 - 08:14 PM

o my sorry for the table
Car insurance table
licenceNo yr_insured yr_insuredExpired model color auto/man owner
111-aaa 1999 2009 beatle pink auto Johnson
222-bbb 1999 2009 mustang white auto Trot
333-ccc 2000 2010 tacoma blue auto White
444-ddd 2007 2017 f-350 blue auto Black
555-eee 2005 2015 d-2500 black auto Smith
666-fff 2007 2017 corolla white man Lee
777-ggg 2010 2020 matrix white auto Kim
888-hhh 2008 2018 civic green man Singh
999-iii 2008 2018 escalde black auto Williams
000-jjj 2009 2019 civic red auto Vanderhoot

A Primary key would be the licenceNo.
Superkeys would include (Owner,licenceNo),and ( Owner, licenceNo,model), (Owner,licenceNo,Model,color).
A candidate key could be LicenceNo and owner.
A foreign key could be owner because an owner could have insurance for other things such as home insurance. Model could also be a foreign key because it could identify a table which shows insurance rates for certain vehicles.
Was This Post Helpful? 0

Page 1 of 1