Spring 2013: Database Midterm

  1. [5 points] Name and describe the four components of a typical database system. How does SQL fit into this system?

  2. [3 points] Databases contain integrated tables. What is an integrated table and what is meta-data?

  3. [2 points] What is the result when a select statement is executed?

    Table 1: MINIATURES
    ItemNumberLine DescriptionPrice
    77019 Dark Haven: BonesOrc Swordsman (3) 5.49
    77020 Dark Haven: BonesBathalian 2.49
    77013 Dark Haven: BonesMinotaur 3.49
    77001 Dark Haven: BonesSkeletal Spearmen (3) 4.99
    03608 Dark Haven: LegendsAquatic Familiars II (4) 7.79
    03650 Dark Haven: LegendsFire Elemental(Medium) 6.99
    20021 Legendary EncountersBathalian 4.99
    Table 2: ORDERS
    UserIDItemNumberQuantity
    10000 77019 2
    10000 77001 5
    10000 03608 1
    10001 77019 1
    10001 77013 1
    ORDERS.ItemNumber is a foreign key which corresponds to MINIATURES.ItemNumber.

  4. [3 points] Provide a SQL query which will print out all of the miniatures in the MINIATURES table from the Dark Haven: Legends line.

  5. [3 points] Provide a SQL query which will show the total number of items ordered by each user in the ORDERS table.

  6. [3 points] Provide a SQL query which will show the Description of all items ordered by UserID 10000, This list should be presented in alphabetic order.

  7. [3 points] Provide a SQL query which will compute the total order cost for UserID 10001 (cost = ΣPrice*Quantity)

    Table 3: PHOTOS
    ItemNumberPhotoNamePainterTags
    02568bathalian1.jpgMichael Genet Robe, Cloth, Staff
    02568bathalian2.jpgSean Fulton Robe, Cloth, Staff
    03135bathalian3.jpgPatrick KeithRobe, Boots
    03135bathalian4.jpgPatrick KeithRobe, Boots
    03135bathalian5.jpgMichaelRobe, Boots

  8. [4 points] What is a modification Anomalies?

  9. [4 points] How are anomalies eliminated in databases?

  10. [4 points] Identify potential anomalies in the ORDER and MINIATURES tables.

  11. [4 points] Identify the functional dependencies in the PHOTOS table.

  12. [2 points] Identify any multivalued dependencies in the PHOTOS table.

  13. [10 points] Apply the normalization process to the PHOTOS table.
    1. Provide the schema for the final database.
    2. Include the identification of primary, foreign and surrogate keys.
    3. List any referential integrity constraints.
    4. List any assumptions you made.