A relation instance r(R) satisfies a dependency X → Y if
We say that "Y is functionally dependent on X ". Attribute sets X and Y may overlap; it is trivially true that X → X. Notes:
Consider the following (redundancy-laden) relation: Some functional dependencies in this relation
Consider an instance r(R) of the relation schema R(ABCDE): A | B | C | D | E ----+----+----+----+---- a1 | b1 | c1 | d1 | e1 a2 | b1 | c2 | d2 | e1 a3 | b2 | c1 | d1 | e1 a4 | b2 | c2 | d2 | e1 a5 | b3 | c3 | d1 | e1 Since A values are unique, the definition of fd gives:
Other observations:
In practice, choose a minimal set of fds (basis)
Real estate agents conduct visits to rental properties
The spreadsheet ... P# | When | Address | Notes | S# | Name | CarReg ---+-------------+------------+---------------+-----+-------+------- P4 | 03/06 15:15 | 55 High St | Bathroom leak | S44 | Rob | ABK754 P1 | 04/06 11:10 | 47 High St | All ok | S44 | Rob | ABK754 P4 | 03/07 12:30 | 55 High St | All ok | S43 | Dave | ATS123 P1 | 05/07 15:00 | 47 High St | Broken window | S44 | Rob | ABK754 P1 | 05/07 15:00 | 47 High St | Leaking tap | S44 | Rob | ABK754 P2 | 13/07 12:00 | 12 High St | All ok | S42 | Peter | ATS123 P1 | 10/08 09:00 | 47 High St | Window fixed | S42 | Peter | ATS123 P3 | 11/08 14:00 | 99 High St | All ok | S41 | John | AAA001 P4 | 13/08 10:00 | 55 High St | All ok | S44 | Rob | ABK754 P3 | 05/09 11:15 | 99 High St | Bathroom leak | S42 | Peter | ATS123
Above examples consider dependency within a relation instance r(R). More important for design is dependency across all possible instances of the relation (i.e. a schema-based dependency). This is a simple generalisation of the previous definition:
E.g. real estate example
Can we generalise some ideas about functional dependency?
E.g. do some dependencies suggest the existence of others?
Armstrong's rules are general rules of inference on fds.
F2. Augmentation e.g. X → Y ⇒ XZ → YZ
F3. Transitivity e.g. X → Y, Y → Z ⇒ X → Z
Armstrong's rules are complete, but other useful rules exist:
F5. Projectivity e.g. X → YZ ⇒ X → Y, X → Z
F6. Pseudotransitivity e.g. X → Y, YZ → W ⇒ XZ → W
Example: determining validity of AB → GH, given:
R = ABCDEFGHIJ F = { AB → E, AG → J, BE → I, E → G, GI → H } Derivation:
Produced: 5 Nov 2020 |