Академический Документы
Профессиональный Документы
Культура Документы
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
TRUCK
Tid TowingCapacity OpId
Airplane
Tid PlaneModel OpId
BOAT
Tid CurrentPort OpId
CUSTOMER
CustId
12345
23456
INDIVIDUAL
CustId ID Address CardNum Name
BUSINESS
CustId AccountNumber Name Address ContractRate
TRANSFER
TrackNum TId WId DateTime
SHIPS_TO
TrackNum TId CustId
WAREHOUSE
WId Address Capacity
DELIVERY_PERSON
DId Name ServiceArea
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