Presentation is loading. Please wait.

Presentation is loading. Please wait.

Db design / ER Modeling 20031 319B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052

Similar presentations


Presentation on theme: "Db design / ER Modeling 20031 319B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052"— Presentation transcript:

1 db design / ER Modeling 20031 319B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052 steinbus@cs.waikato.ac.nz

2 db design / ER Modeling 20032 4. Sub- and Supertypes Supertype Subtype Complete decomposition Uncomplete decomposition Exclusive decomposition Inclusive decomposition Multilayer decomposition Multiple decomposition

3 db design / ER Modeling 20033 4.1 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

4 db design / ER Modeling 20034 4.2 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

5 db design / ER Modeling 20035 4.3 complete decomposition The supertype is the union of his subtypes Example:

6 db design / ER Modeling 20036 4.4 incomplete decomposition The supertype can contain entities which are not in the decomposition Example:

7 db design / ER Modeling 20037 4.5 exclusive decomposition The subtypes are disjoint (mutually exclusive) Example:

8 db design / ER Modeling 20038 4.6 inclusive decomposition The subtypes can have entities in common Example:

9 db design / ER Modeling 20039 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)

10 db design / ER Modeling 200310 4.7 Multilayer decomposition Example:

11 db design / ER Modeling 200311 4.8 Multiple decomposition Example:

12 db design / ER Modeling 200312 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)

13 db design / ER Modeling 200313 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.)

14 db design / ER Modeling 200314 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.


Download ppt "Db design / ER Modeling 20031 319B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052"

Similar presentations


Ads by Google