Вы находитесь на странице: 1из 4

Jared Bartrug

CS440 Database Design


3-8-18

During the design of the ER diagram I ran into some issues of how different package
delivery options would be stored. Each package will have different handling instructions and a
long string would be ineffective way to store info. To deal with this I broke out packages into the
main types that would occur, fragile, oversized, and express. By making these subclasses
overlap it allowed packages to be multiple type, like fragile and express. The other issue was
being able to track every step a package takes on its trip.The database needs to be able to
track what customer sent the package, what truck it was on, and where it was going. This initial
package submission was handled with an degree three relationship,SHIPS_TO, with a
transport, customer, and package. The relation SHIPS_TO would track the packages as they
are submitted and assigned an initial transport. It would be rare for the package to have only
one transport for its journey. Another degree 3 relation will handle internal transfers to different
warehouses. These two degree three relations will provide a record of the packages until they
go out for delivery.

For the degree three relationships the only option was a lookup table, but when possible
foreign keys were used to minimize the number of tables in the database. To accommodate the
disjoint inheritance, each of the transport types got their own table. This allows each table to
contain only relevant information without any data duplication. For the overlapping inheritance
the best option was to use flags to distinguish if a package was fragile, oversized or express.
The last dilemma faced was the customer category. A surrogate key, CId, was created then
added into the individual category tables.

OPERATOR
OpId Name CertLevel

23481 John Smith 1

48736 Jane Lew 2

35249 Eric Holt 2

85921 Emily Lou 5

TRUCK
Tid TowingCapacity OpId

38492 20000 48736

32712 25000 35249

Airplane
Tid PlaneModel OpId

76473 747 23481

BOAT
Tid CurrentPort OpId

73261 Miami, FL 85921

CUSTOMER
CustId

12345

23456
INDIVIDUAL
CustId ID Address CardNum Name

12345 58328 123 Example St, 1111222233334444 Elaine Lee


Morgantown, WV 26554

BUSINESS
CustId AccountNumber Name Address ContractRate

23456 6324981234 Toy Shop 24 High St, $1/lb


Morgantown, WV 26505

TRANSFER
TrackNum TId WId DateTime

37256134 38492 74 3-7-18 8:00PM

SHIPS_TO
TrackNum TId CustId

37256134 38492 12345

WAREHOUSE
WId Address Capacity

74 12 Fairmont Ave, Fairmont WV 26554 8000

DELIVERY_PERSON
DId Name ServiceArea

1 Matthew Jacobs New York, NY

PACKAGE
TrackNu Weight CurrentLocation Destination Origin Did Fflag Insurance FragileLevel Oflag Dimensions Eflag Speed
m
37256134 2 Fairmont,WV Akron, OH New 1 1 $200 5 0 NULL 1 5
York,
NY
CONTAINS
TrackNum Wid

37256134 74

Вам также может понравиться