db design / ER Modeling B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052
db design / ER Modeling Sub- and Supertypes Supertype Subtype Complete decomposition Uncomplete decomposition Exclusive decomposition Inclusive decomposition Multilayer decomposition Multiple decomposition
db design / ER Modeling Supertype Abstraction of similar entity types Build if –‚similar‘ entity types have the same relationships –‚similar‘ entity types have attributes in common Inheritance of attributes and relationships to the subtypes
db design / ER Modeling Subtypes Specialization of an entity type Build if –Some entities owns additional attributes –Some entities have additional relationships Inherits the attributes and relationships from the supertype
db design / ER Modeling complete decomposition The supertype is the union of his subtypes Example:
db design / ER Modeling incomplete decomposition The supertype can contain entities which are not in the decomposition Example:
db design / ER Modeling exclusive decomposition The subtypes are disjoint (mutually exclusive) Example:
db design / ER Modeling inclusive decomposition The subtypes can have entities in common Example:
db design / ER Modeling Example skier A skier is trained by exactly one trainer and belongs to one club He or she is specialized in one discipline (downhill race, slalom,..) For every discipline there are competitions a skier can takes part in a competition (solution: example 6)
db design / ER Modeling Multilayer decomposition Example:
db design / ER Modeling Multiple decomposition Example:
db design / ER Modeling Example airline An airline owns several planes of different types (B747, B767,..) under their employes there are pilots and maintenance staff A pilot can navigate several plane types A flight have to be assigned at least one pilot A plane have to be serviced at some time by persons from the maintenance staff A customer can book a flight for one or more persons A booking position includes a seat number and the class and the information about the passenger (solution: example 7)
db design / ER Modeling Exercise payback.com The company payback.com wants to create a database to support payback programs. In a payback program there are one or more companies on one side which are offering services or goods (called services in what follows) and on the other side there are customers requesting these services. If the customer pays for a service with cash (or credit card) he gets some bonus points; with these bonus points he can buy other services from any company in the same payback program. (For simplification a payment shall always be carried out exclusively with cash or bonus points.)
db design / ER Modeling Exercise (cont.) 1.In a payback program there is at least a company, and none or many customers. 2.A customer (and of course a company) can take part at many payback programs. 3.A customer gets for every membership an account, where his bonus points are recorded. 4.Every company offers at least one service; every service is offered by exactly one company (for sake of simplicity) 5.For every service the number of bonus points earned (if bought by cash) and the number of bonus points which are necessary (if bought by bonus points) must be recorded. (The price doesn't matter.) 6.In a transaction log must be recorded the service, the customer‘s account in that payback program and if bought by cash or bonus points.