Page 30 - AIS access_chang_ingraham
P. 30

28     CHAPTER 2  DATA MODELS AND RELATIONAL DATABASES





       Vendor#     Vendor        Vendor          Contact        Phone#      Item#    Description      Unit
                   Name          Address         Name                                                 Price
       2010        AXA, Inc.     22 Heaven       Annie White    234-3435    M-45     Blender         $15.99
                                 Wood Drive                                 K-4      iPod            $65.00
       2011        Sys Co.       2273 Morgan     John Doe       655-7512    D-12     LCD projector   $560.00
                                 Street
       2021        MFS           46 Kings        Rachelle       234-7799    M-45     Blender         $18.00
                                 Square, #5      Brown                      K-4      iPod            $63.80
       2013        Lazard        8 Santa Ana     Ed King        734-0109    K-8      DVD player      $134.00

       2014        XYZ Co.       19 Columbus     Lan Lee        878-1888    K-8      DVD player      $129.99
                       FIGURE 2-7   Partial Data in a Vendor Table



                       the primary key cannot be null. That is, without specific information of a vendor, we cannot
                       inselt any inventory data. The worst anomaly is the delete anomaly. If Sys Co. is out of busi-
                       ness and we would like to delete its record from the database, we would accidentally delete
                       the inventory information of LCD projectors if Sys Co. is the only one selling LCD projec-
                       tors to the company.

                       Steps in Normalization

                       Normalization can be understood and accomplished in stages. Each stage corresponds to a
                       normal form. In this book, we describe and illustrate the steps to reach first, second, and
                       third normal forms. The fifth normal form is the highest level of normalization in which
                       any remaining anomalies are removed.
                       Step 1:   Remove any repeating groups (First Normal Form).
                       Any repeating groups must be separated into a different table to reach the first normal form.
                       Repeating groups are those related attributes with multivalued data. In the above-mentioned
                       vendor table, inventory information of item#, descIiption, and unit pIice is a repeat group.
                       These columns have multivalued data. Hence, to normalize the vendor table to first normal
                       form, we need to make Vendor Table 1 two tables: Vendor Table 2 and Inventory Table.
                       According to Figure 2-7, the attribute of Unit Price is vendor and item specific. Hence, we need
                       to tentatively exclude this attribute from both tables so that they can reach the fIrst normal
                       fmill. After Step 1, the logical designs of the two tables are: Vendor Table 2 (Vendor#, Vendor
                       Name, Vendor Address, Contact Name, Phone#), and Inventory Table (Item#, DescIiption).
                       Step 2:   Remove any partial dependencies (Second Normal Form).
                       When we normalize a table, we need to make sure the decomposed tables are linked so
                       data can be retrieved from them. Tentatively, let's use Item# with Vendor# in the vendor
                       table as a concatenated key so we can add back the attribute of Unit Price to the new vendor
                       table. This proposed table has a logic design as follows: Vendor Table 3 (Vendor#, Item#,
                       Vendor Name, Vendor Address, Contact Name, Phone#, Unit Price).
                             This proposed table has the problem of partial dependency. Partial dependency
                                                     7
                       exists if any non-key attribute is dependent on part, not all, of the primary key. That is,

                       7Non-key attributes are those attributes that are not the primary key.
   25   26   27   28   29   30   31   32   33   34   35