Part 1 (20 points)
Assume that we have the following database for the Union-Times newspaper.
Most of these fields are self-explanatory – ask if you have
a question. Filename is the filename that an article has,
Photo_filename is the filename a photograph has. The value of Source is either
Local, Freelance, Reuters or New York Times. ArticleDate is the date an article
is written. PublicationDate is the date that an article is published. TakenDate
is the date a photograph is taken. Byline is either Yes or No – whether the
reporter's name is on the article. Paid is the amount of money paid to the
photographer. We only store data about Reporters who work for the
An article has at least one topic and at least 0 photographs.
ARTICLES(Filename, ArticleDate, PublicationDate, Source)
WRITES(Filename, ReporterName,
Byline)
REPORTERS(ReporterName, StartDate, EndDate, Speciality, Salary, SocialSecurityNumber)
TOPICS(Filename, Topic)
PHOTOGRAPHS(Photo_filename, Photographer, Source, TakenDate, Paid)
PHOTOS_INCLUDED(Filename, Photo_filename)
Draw an entity-relationship diagram..
0..1
Part 2 (35 points)
Answer the questions in this part using the database from Part 1:
No. since it is a non-key field in the Reporters table. There
can be just one Speciality for each ReporterName.
2. Can an article be written by more than one reporter?
Yes, since ReporterName is part (but not all) of the
primary key for the Writes table.
No, it's part of the primary key.
> 0
000-00-0000
Filename or ReporterName in WRITES. Filename
in TOPICS. Photo_filename or Filename in PHOTOS_INCLUDED.
Topic in TOPICS. Souce in ARTICLES or PHOTOGRAPHS. Speciality
in REPORTERS.
Part 3 (45 points – 15 points each)
The following tables are not 3NF. Convert them to 3NF. In the process, you are not allowed to add additional data fields.
1.
This table stores information about hiking
in the
(Mountain, Date, Elevation, Trail Conditions, Distance, Time)
(Mountain, Date, Trail
Conditions, Time)
(Mountain, Elevation, Distance)
2. This table stores information about tennis matches. You can assume that the names of all opponents are unique, and that you can play more than one person per day. Court is the location where the games occur. You can assume that you play tennis at no more than one location per day.
(Date, Court, Temperature, (Opponent, OpponentPhone, MyScore, TheirScore))
(Date, Court,
Temperature)
(Date, Opponent, MyScore,
TheirScore)
(Opponent, OpponentPhone)
3. This table stores information about package deliveries. Each package has a unique PackageID.
(PackageID, Date, DeliveryAddress, CustomerID, CustomerName, CustomerPhone, Price)
(PackageID, Date,
DeliveryAddress, CustomerID, Price)
(CustomerID, CustomerName, CustomerPhone)