Page 35 - AIS access_chang_ingraham
P. 35

PROBLEMS      33




                                               Business situations                              Cardinalities

                                                                                       Sales       Cash collections

                                1. Cash sales                                          (1,1)            (1,1)
                                2. Installment sales for firms like car dealers;
                                   down payment is required.
                                3. The company often has credit sales. Customers
                                   must pay full amount for each transaction.

                                                                                       Sales       Inventory

                                4. A regular retail store that sells low-cost, mass-
                                   produced items and often carries new items.
                                5. A construction company that builds custom
                                   homes only.

                          2.3  Normalize a wholesale company's database
                               Given below is the design of a Sales table for a wholesale company. Indicate the primary key for the
                               table. Given the current design of this table, list two violations of the basic requirements of a relational
                               data model. Indicate possible anomalies in the table and then normalize the table to third normal form.


                                SO#     Invoice   Item    Description   Quantity   Unit      Customer#     Customer
                                        Date      #                     Ordered    Price                   Name

                                101     7/5/2006  2033    Washer        5          $359.99   22            Brown Co.
                                                  2051    Dryer         8          $372.00
                                102     7/5/2006   1099   TV            4          $258.00   26            Homebase

                                103     7/6/2006  2028    VCR           10         $179.99   24            Easy Shop
                                                  2034    CD player     10         $185.00
                                                  2045    DVD player    5          $200.00

                                104     7/8/2000   1099   TV            15         $258.00   22            Brown Co.


                          2.4  Normalize a library's database
                               Given below is the table of data for a library. First, determine which attribute is the best primary key.
                               Second, examine the table and indicate the anomalies that may occur with the original design of this
                               database. Why? Third, nOlmalize the table into the third normal form to prepare it for use in a rela-
                               tional database environment.


                                Call#      Title            Borrower    First Name   Last Name   Date Out    Date Due
                                                            10#      ~.f
                                K561.02    Soccer           S551442     John         Austin      12-03-05    01-03-06
                                D221.67    US Presidents    S702361     James        Wilson      12-20-05    01-20-06
                                1264.89    HR Laws &        F012618     Mark         Ding        12-20-05    03-20-06
                                           Regulations
                                H122.34    Volcanoes        S702361     James        Wilson      12-20-05    01-20-06
                                K249.02    Swimming         S002579     Freddie      Sunder      01-03-06    02-03-06
                                M426.52    Egypt            S002579     Freddie      Sunder      01-03-06    02-03-06
                                K922.4     Badminton        F012618     Mark         Ding        01-05-06    04-05-06
   30   31   32   33   34   35   36   37   38   39   40