8.50 What are the risks and problems of forward engineering?
Much depends on the nature of the changes to be made and the quality of the forward engineering
❖ ANSWERS TO PROJECT QUESTIONS
8.51 Suppose that the table EMPLOYEE has a 1:N relationship to the table
PHONE_NUMBER. Further suppose that the primary key of EMPLOYEE is EmployeeID
and the columns of PHONE_NUMBER are PhoneNumberID (a surrogate key),
AreaCode, LocalNumber, and EmployeeID (a foreign key to EMPLOYEE). Alter this
design so that EMPLOYEE has a 1:1 relationship to PHONE_NUMBER. For employees
having more than one phone number, keep only the first one.
To start with, let’s write out the table structure:
EMPLOYEE (EmployeeID, {Other Attributes})
8.52 Suppose that the table EMPLOYEE has a 1:N relationship to the table
PHONE_NUMBER. Further suppose that the key of EMPLOYEE is EmployeeID and the
columns of PHONE_NUMBER are PhoneNumberID (a surrogate key), AreaCode,
LocalNumber, and EmployeeID (a foreign key to EMPLOYEE). Code all SQL
statements necessary to redesign this database so that it has just one table. Explain the
difference between the result of question 8.51 and the result of this question.
To start with, let’s write out the table structure:
Now we:
(1) Add the columns AreaCode and LocalNumber to EMPLOYEE.