No Slide Title

Download Report

Transcript No Slide Title

A.
BadMouth Press works with several different authors who write the books it
publishes. Some authors have written only one book, while others have written many;
also, some books are co-author by multiple authors. BadMouth also works with
multiple printers; each book, though, is printed by only one printer. An editor at
BadMouth Press works with several authors at a time, editing and producing their book
projects; it is the editor's job to turn over the final camera-ready copy to the printer
when the manuscript has been copy edited and typeset.
1. Identify the entities
Editor
Editor ID (PK)
Editor Name
Editor Addr e
Author
Author ID (PK)
Writes
Author Name
Author Addr
Book
Book ID (PK)
Book Desc
Printer
Printer ID (PK)
Printer Name
1. Review Relationships
Books writtten by many authors
Books only have one printer
Editors work for multiple authors
Author
Author ID (PK)
Author Name
Author Addr
Writes
Author/Book
Auth-book (PK)
Author ID(FK)
Book ID (FK)
Written
Book
Book ID (PK)
Book Desc
Printer ID(FK)
Has editting
Prints
Printed By
Editor
Editor ID (PK)
Editor Name
Editor Addr
Edits
Editor/Author
Edit-auth (PK)
Editor ID(FK)
Author ID (FK)
Printer
Printer ID (PK)
Printer Name
A.
SkyHigh Airlines has three major resources: airplanes, pilots, and
crew members. Pilots and crew members have respective home bases,
which they return at the end of an assigned flight. A flight must have at
least one pilot and one or more crew members attached to an airplane.
Each airplane has a maintenance base.
1. Identify the entities
Crew
Crew ID (PK)
Crew Name
Crew Addr
Home Base
Home Base ID (PK)
Home Base Place
Airplane
Airplane ID (PK)
Airplane type
Pilot
Pilot ID (PK)
Pilot Name
Flight
Flight ID (PK)
Flight date
Main Base
Main Base ID (PK)
Main Base place
2. When there is a 1-1 relationship no association table is necessary
Home Base
HmeBaseID (PK)
Home Base Place
Resides
Pilot
Pilot ID (PK)
Pilot Name
Home Base (FK)
Flight
Flight ID (PK)
Flight date
Planned
Flys
Resides
Main Base
Main Base ID (PK)
Main Base place
Resides
Crew
Crew ID (PK) Crew
Name
Crew Addr
Home Base(FK)
Flys
Flight
Flight info(PK)
Flight Id (FK)
Crew ID (FK)
Pilot ID(FK)
Airplane ID (FK)
Scheduled
Airplane
Airplane ID (PK)
Airplane type
Main Base(FK)