Page 31 - AIS access_chang_ingraham
P. 31
QUESTIONS AND PROBLEMS FOR REVIEW 29
Vendor Name, Vendor Address, Contact Name, Phone# are functionally dependent on
Vendor# only, not both Vendor# and Item#. Only Unit Price is dependent on the whole pri-
mary key. Hence, we need to decompose Vendor Table 3 into two tables: Vendor Table 4
(Vendor#, Vendor Name, Vendor Address, Contact Name, Phone#), and Vendor-Inventory
Table (Vendor#, Item#, Unit Price). The Vendor-Inventory Table is a relationship table to
link the Inventory Table and Vendor Table 4. Examine Figure 2-7 again, we know that the
relationship between the entities (i.e., vendor and inventory) is many-to-many. As we
mentioned earlier, whenever there is a many-to-many relationship, we must use a relation-
ship table to link the two entities. If we do not do so, the tables are not normalized.
Step 3: Remove any transitive dependencies (Third Normal Form).
A transitive dependency in a table is a functional dependency between two or more non-key
attributes. Refer to Figure 2-7, the attribute Description is dependent on Item#, not the pri-
mary key Vendor#, although Item# is dependent upon Vendor#. This is a case of transitive
dependency. After our first two steps of normalization, we have also removed transitive
dependency from the original table design. Our final results of normalization are three tables:
Inventory Table (Item#, Description)
Vendor Table 4 (Vendor#, Vendor Name, Vendor Address, Contact Name, Phone#)
Vendor-Inventory Table (Vendor#, Item#, Unit Price)
Summary of Normalization
Normalization is a formal process to determine which attributes should be grouped togeth-
er in a table. It validates the logical design to avoid any violation of database requirements.
Normalization is done by decomposing a table with anomalies into smaller, well-struc-
tured tables. A table is in first normal form (lNF) if it contains no repeating groups (mul-
tivalued attributes). A table is in second normal form (2NF) if it is in first normal form and
if every non-key attribute is fully dependent on the primary key. A table is in third normal
form (3NF) if it is in second normal form and if all the non-key attributes are independent
from each other (i.e., no transitive dependency). Any table at third normal form will have
no update anomaly, no insert anomaly, and no delete anomaly.
KEVTERMS
primary key concatenated/composite key insert anomaly
foreign key relationship tables ; , delete anomaly
entity integrity rule normalization .,. third normal form
referential integrity rule update anomaly
QUESTIONS AND PROBLEMS FOR REVIEW
MULTIPLE-CHOICE QUESTIONS
2.1 In designing a database, what is the referential integrity rule?
(a) The primary key in a table should not be null.
(b) The foreign key in a table should not be null.

