Solving the Problem By Taking Simple Projections
The particular problem with nulls in this table is readily resolved with a minor change in the logical design of the database. Because the attributes in this employee table are a combination of those that apply to all tuples and those that apply only to some tuples, the relationship is similar to that of a simple entity supertype and subtype, the difference being that the attribute in question, salary, is not unique: all employees receive a salary.
The following tables resolve the problem of multiple simultaneous semantics for the original employee table by taking projections from the original employee table:
employee |
|
employee_salary |
||||
emp_num |
emp_name |
dept_num |
hire_date |
|
emp_num |
salary |
PK |
|
|
|
|
PK |
|
214 |
Smith |
32 |
09-12-1989 |
|
214 |
56150 |
447 |
Lau |
15 |
05-30-1993 |
|
103 |
29775 |
103 |
Hossein |
09 |
09-13-1984 |
|
500 |
84932 |
500 |
Nakamura |
11 |
06-09-1997 |
|
|
|
713 |
Schroeder |
24 |
10-29-2001 |
|
|
|