Database Systems: Design, Implementation, and Management 13 Edition
Database Systems: Design, Implementation, and Management 13 Edition
• Composite key
– Composed of more than one attribute
• STU_LNAME, STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS
or
• STU_LNAME,STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS, STU_GPA
or
• STU_LNAME,STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS, STU_GPA, STU_DOB
Example Tables
Relational Database Keys (Cont’d)
• Secondary key
– Key used strictly for data retrieval purposes.
Simple Relational Database
Functional dependence
• The term functional dependence can be
defined most easily this way: the attribute B
is functionally dependent on A if A
determines B.
More precisely:
• The attribute B is functionally dependent
on the attribute A if each value in column
A determines one and only one value in
column B.
Functional dependence
• STU_PHONE is functionally dependent on
STU_NUM.
– For example, the STU_NUM value 321452
determines the STU_PHONE value 2134.
• On the other hand, STU_NUM is not
functionally dependent on STU_PHONE
– because the STU_PHONE value 2267 is
associated with two STU_NUM values: 324274
and 324291.(hostel situation)
Full Functional Dependence
• The notion of functional dependence can
be further refined by specifying full
functional dependence:
If the attribute (B) is functionally
dependent on a composite key (A) but
not on any subset of that composite key,
the attribute (B) is fully functionally
dependent on (A).
Full Functional Dependence:
Examples:
• STU_LNAME, STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS
or
• STU_LNAME,STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS, STU_GPA
or
• STU_LNAME,STU_FNAME, STU_INIT, STU_PHONE → STU_HRS, STU_CLASS, STU_GPA, STU_DOB