Refer to the assignment 3 for
definitions of what is meant by a database design outline and an
entity-relationship diagram.
Q1. Normalization with a Repeating Group: suppose that a car wash keeps records in the following form, using only one table.
|
|
License |
|
|
Cust |
Cust |
AddOn |
AddOn |
AddOn |
|
3/5/2007 |
LDR47X |
Honda |
Accord |
128 |
Jane Wright |
|
|
|
|
3/8/2007 |
378MXZ |
Toyota |
Camry |
231 |
Janet Wu |
HTWX |
Hot Wax |
$8.95 |
|
|
|
|
|
|
|
UDCT |
Undercoat |
$6.95 |
|
3/12/2007 |
IYR32B |
Nissan |
Altima |
403 |
Felix Ortiz |
|
|
|
|
3/15/2007 |
PRQ19R |
Honda |
Civic |
231 |
Janet Wu |
HTWX |
Hot Wax |
$8.95 |
|
3/15/2007 |
ZZT342 |
Pontiac |
GTO |
403 |
Felix Ortiz |
FMPL |
Foam Polish |
$2.95 |
|
|
|
|
|
|
|
HNWX |
Hand Wax |
$29.95 |
|
|
|
|
|
|
|
TRSL |
Tire Seal |
$4.45 |
|
3/16/2007 |
AGX112 |
Dodge |
Magnum |
334 |
Bill Shor |
|
|
|
|
3/31/2007 |
LDR47X |
Honda |
Accord |
128 |
Jane Wright |
TRSL |
Tire Seal |
$4.45 |
The fields AddOnCode, AddOnDescrip, and AddOnCharge form a "repeating group" indicating which optional services were added to the basic wash operation. The interpretation of the data above is:
You may assume that the car wash always charges the same amount for each
optional service, no matter the date of service, the kind of car, or the
customer involved. Redesign this database so it is in third normal form. Draw an entity-relationship diagram and write a database
design outline (as defined in assignment 3). You may add "ID" fields where necessary.
Q2. More Query Exercises: From the class website, download the file sports-with-games.mdb, similar to the database used in class on March 27. For each of the following, create a query, hand in a printed screen shot of the query design window, and hand in a printout of the query results (see assignment 7 for screen-shot instructions; when available, refer to the assignment 7 solution for examples of what the output should look like).
Q3. Query Chaining: For the same database as Q2, create a set of interconnected queries whose final output is a table with a row for each team and four columns showing, respectively:
Sort the results alphabetically by team nickname. Hand in the final resulting table, and a screen shot of the design window for each of the queries you interconnected. Hint: one possible approach is to make a query computing the number of home games won for each team, and another query computing the number of away games won for each team; finally, you can make a third query combining information from the first two queries, and possibly the teams table as well.