Let R1 and
R2 be a
decomposition of
R
If either R1 ∩ R2 → R1 or R1 ∩ R2 → R2 , then:
|
|
|
A → B |
(I.e.: (1) A is not a super key and (2) B is not part of a key)
Then you can decompose (= break up) the relation R into the following 2 relations R1 and R2 losslessly:
|
Employee1(SSN, FName, LName, PNumber, PName, Hours) |
SSN → FName, LName Because: (1) SSN is not a superkey and (2) FName, LName is not part of a key |
Applying Lemma 2, the following decomposition will be lossless:
Employee1(SSN, FName, LName, PNumber, PName, Hours) SSN+ = (SSN, Fname, LName) |
SSN | FName | LName | PNumber | PName | Hours |
---|---|---|---|---|---|
111-11-1111 | John | Smith | pj1 | DBApplet | 20 |
111-11-1111 | John | Smith | pj2 | WebServer | 10 |
111-22-3333 | Jane | Doe | pj1 | DBApplet | 5 |
Decomposition:
|
|
|
* |
|
= |
SSN | FName | LName | PNumber | PName | Hours |
---|---|---|---|---|---|
111-11-1111 | John | Smith | pj1 | DBApplet | 20 |
111-11-1111 | John | Smith | pj2 | WebServer | 10 |
111-22-3333 | Jane | Doe | pj1 | DBApplet | 5 |
I.e., we have perserve the exact content - no more and no less
Employee1(SSN, FName, LName, PNumber, PName, Hours)
into:
R1 (SSN, FName, LName) R2 (SSN, PNumber, PName, Hours)
|
This decomposition is lossless because:
(1) R1 ∩ R2 = (SSN) and (2) SSN → SSN, FName, LName = R1 !!! |