1 / 3

Sometimes a Unique Key Must Be Composite

Sometimes a Unique Key Must Be Composite. CourseSections(crsNo, facID, room, days, secNo, capacity, term, time) For example, one row might be (CSC1035, 22, MSCG86, TTh, 001, 28, F12, 4:00)

dewitt
Download Presentation

Sometimes a Unique Key Must Be Composite

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sometimes a Unique Key Must Be Composite • CourseSections(crsNo, facID, room, days, secNo, capacity, term, time) • For example, one row might be (CSC1035, 22, MSCG86, TTh, 001, 28, F12, 4:00) • It means the course CSC1035, section 001, meets in MSC G86 on Tuesday and Thursday at 4:00 in Fall 2012. It is taught by faculty member 22 and has capacity 28.

  2. CourseSections Example • We see that the attribute (term) isn’t a unique key. For example, many course sections may be offered in one term. • Even the composite (facID, crsNo) isn’t unique, since the same instructor may teach the same course (either in multiple sections, or over multiple terms).

  3. CourseSections Example • However, the set (crsNo, secNo, term) is unique, so it’s a candidate key. • There are others: can you find them? • If we choose the one above as PK, we’d write: • CourseSections(crsNo, facID, room, days, secNo, capacity, term, time)

More Related