Composite pkeys in RDB’s
Every tuple must have a unique field (or set of fields) called its primary key (pkey) which uniquely identifies it.
A composite pkey for a child or component tuple is often built by concatenating multiple key fields from a chain of ancestors. This complicates pkey-to-fkey matching.
Example: Dept--->Course--->Section (ERD on next slide)
- CS has Dept# = 91 and OOAD has course# = 91.522.
- Almost every course has a section # 201, so 201 is only a unique identifier within the child set of sections of a particular course, just as 522 is only a unique course# within a particular Department.
- (In my syllabus I renamed this 01f522 - Dept 91 is assumed. 01f adds a new ‘term=Fall 2001’ component to this identifier. I teach only one section of CS Dept courses over multiple terms.)