Management Information Systems (33:623:370) 
Fall 2008, Professor Eckstein
Assignment 8

Due: Wednesday, November 19

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.


Date

License
Plate


Make


Model

Cust
Code

Cust
Name

AddOn
Code

AddOn
Descrip

AddOn
Charge

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).

  1. Produce a table of all coaches, showing (in order) first name, last name, the nickname of their team, status, and phone number.  Sort the table alphabetically by team nickname; within each team, list status "2" coaches first, and then status "1" coaches.
     
  2. Produce a table of all teams, showing (in order) their nicknames and the total number of coaches they have.  Sort the table alphabetically by nickname.  Teams with no coaches should still appear in the list, showing zero for the number of coaches (hint: you will have to manipulate join properties).
     
  3. Produce a table showing (in order) the first name, last name, and team nickname for all "A"-level players who have a status "2" coach.  Sort alphabetically by player last name.
     
  4. Produce a table of all games showing (in order) the date played, home team nickname, home team score, visiting team nickname, and visiting team score.  Sort the table from earliest to latest date played, and within the same date played, sort alphabetically by home team nickname.
     

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:

  1. The team name
  2. The team colors
  3. The number of home games the team won
  4. The number of away games the team won.

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.