| Attribute | |||
|---|---|---|---|
| Name | John Walker | Jim Bim | |
![]() | Pers.ID | 1 | 1 |
![]() | Dept. No. | 1 | 2 |
| Dept. Name | Europe | USA | |
| Project No. | 5, 7, 8 | 5, 8 | |
| Project Name | Soap, Pasta, OliveOil | Soap, OliveOil | |
| Job in Project | Analysis, Leader, Marketing | Leader, Leader | |
| Salary/h | 13, 18, 15 | 18, 18 |
| Attribute | |||
|---|---|---|---|
| Name | John Walker | Jim Bim | |
![]() | Pers. ID | 1 | 1 |
![]() | Dept. No. | 1 | 2 |
| Dept. Name | Europe | USA |
| Attribute | ||||
|---|---|---|---|---|
![]() | Project No. | 5 | 7 | 8 |
| Project Name | Soap | Pasta | OliveOil |
| Attribute | ||||||
|---|---|---|---|---|---|---|
![]() | Project No. | 5 | 5 | 7 | 8 | 8 |
![]() | Pers. ID | 1 | 1 | 1 | 1 | 1 |
![]() | Dept. No. | 1 | 2 | 1 | 1 | 2 |
| Job in Project | Analysis | Leader | Leader | Marketing | Leader | |
| Salary/h | 13 | 18 | 18 | 15 | 18 |
Here: In the relation "Employees" the "Dept. Name" depends only on the "Dept. No." but not on "Pers. ID", thus not on all parts of the key:
|
|
The relations "Projects" and "Project Assignment" can remain as they are:
| Attribute | ||||
|---|---|---|---|---|
![]() | Project No. | 5 | 7 | 8 |
| Project Name | Soap | Pasta | OliveOil |
| Attribute | ||||||
|---|---|---|---|---|---|---|
![]() | Project No. | 5 | 5 | 7 | 8 | 8 |
![]() | Pers. ID | 1 | 1 | 1 | 1 | 1 |
![]() | Dept. No. | 1 | 2 | 1 | 1 | 2 |
| Job in Project | Analysis | Leader | Leader | Marketing | Leader | |
| Salary/h | 13 | 18 | 18 | 15 | 18 |
Here:
The relations "Employees", "Depends" and "Projects" can remain as they are.
But in "Projects Assignment" the salary depend only on the job, thus only indirectly on the key.
This is a transitive dependency. We have to add a "Payment" relation.
|
|
|
|
| Attribute | ||||||
|---|---|---|---|---|---|---|
![]() | Project No. | 5 | 5 | 7 | 8 | 8 |
![]() | Pers. ID | 1 | 1 | 1 | 1 | 1 |
![]() | Dept. No. | 1 | 2 | 1 | 1 | 2 |
| Job in Project | Analysis | Leader | Leader | Marketing | Leader |
Note: We could add an"Assignment No." in the "Project Assignment" relation as new key to avoid having only key attributes.
Now the DB is in 3NF: No Data-field modification should necessitate any other "follow-up" adjustment in any other data-field, because of transitive dependencies. Vale?