Presentation is loading. Please wait.

Presentation is loading. Please wait.

Conceptual / semantic modelling 1. 2 Overview design; conceptual design; ER model concepts; semantic aspects; problems; Enhanced ER (EER) modelling; transforming.

Similar presentations


Presentation on theme: "Conceptual / semantic modelling 1. 2 Overview design; conceptual design; ER model concepts; semantic aspects; problems; Enhanced ER (EER) modelling; transforming."— Presentation transcript:

1 Conceptual / semantic modelling 1

2 2 Overview design; conceptual design; ER model concepts; semantic aspects; problems; Enhanced ER (EER) modelling; transforming an ER (EER) model into a relational model

3 Conceptual / semantic modelling 3 Design you know the mechanics for building a database system, but dont know how to design it

4 Conceptual / semantic modelling 4 Design requirements specification conceptual (semantic) design logical design physical design and implementation testing and validation maintenance

5 Conceptual / semantic modelling 5 Conceptual (semantic) design constructing a model of the information used in an organisation independently of any targeted DBMS and of any physical considerations - high level of abstraction conceptual model - a more structured description (as opposed to a NL description) try to capture as much meaning as possible model - constructed within a theory terminology (ambiguity): model most popular conceptual data model (theory) ER (or E/R) model (theory) - Chen (1976) UML notation

6 Conceptual / semantic modelling 6 ER model attribute

7 Conceptual / semantic modelling 7 Concepts of the ER model semantic, not formal may be understood differently (by designers); results: different models of the same real life system however, an ER model is a semi-formal description (see below) not directly implementable needs to be translated into an implementable model (e.g. the relational model) why, then, doing it in the first instance? symbolic level formal description based on a set of informally defined concepts most popular: ER diagram

8 Conceptual / semantic modelling 8 Entity entity type a concept identified as having an independent existence entity instance strong/regular entity type weak entity type its existence is dependent on some other entity types examples think...

9 Conceptual / semantic modelling 9 ER diagram - entity (UML) Student Book-Loan Student studNo

10 Conceptual / semantic modelling 10 ER diagram - entity (before)

11 Conceptual / semantic modelling 11 Attributes a property/characteristic of an entity (or relationship) type instances of the same type have properties in common attribute domain should be included in a fully developed data model attributes simple / composite single-valued / multi-valued derived candidate key / primary key / composite key (note: no foreign key!)

12 Conceptual / semantic modelling 12 ER diagram - attributes (UML) Student name {PPK} dOB {PPK} day month year sex /age address no code city telNo[1..*] course /fees

13 Conceptual / semantic modelling 13 ER diagram - attributes (before)

14 Conceptual / semantic modelling 14 Relationships do not mistake with relation (in the relational model) relationship type a (meaningful) association between entity types participants - the entities involved in the relationship relationship instance degree number of participating entities (types) binary ternary, quaternary … recursive

15 Conceptual / semantic modelling 15 ER diagram - binary relationships (UML) Student name dOB Book Title Author Edition Borrows Department name Belongs To

16 Conceptual / semantic modelling 16 ER diagram - binary relationships (before)

17 Conceptual / semantic modelling 17 ER diagram - ternary relationship (UML) Student name dOB Module code Lecturer name Teach

18 Conceptual / semantic modelling 18 ER diagram - recursive relationships (UML) Represents Representative Represented Student name dOB

19 Conceptual / semantic modelling 19 ER diagram - more than one relationship between two entities Staff name dOB Department name HeadofDepartment Member Manages BelongsTo

20 Conceptual / semantic modelling 20 ER diagram - relationships with attributes (UML) Staff name dOB Department name IsAffiliatedTo date position

21 Conceptual / semantic modelling 21 ER diagram - relationships with attributes (before)

22 Conceptual / semantic modelling 22 Structural constraints on relationships cardinality constraints multiplicity cardinality participation relevant to all possibilities - i.e., not to a certain extension

23 Conceptual / semantic modelling 23 Structural constraints on relationships (UML) Student name dOB Room hall no Tutor name Rents Advises Teaches * 1 1..*

24 Conceptual / semantic modelling 24 ER diagram - structural constraints (before) rented_house tenant rents 1 M landlord owns M N house history has 1 1

25 Conceptual / semantic modelling 25 Problems with ER models connection traps a link between two entities seems to have been represented via another entity, but the actual model does not capture that fan traps symbolically: two (1:M) relationships fan out of an entity it is not always a trap chasm traps symbolically: a pathway representing a link contains a relationship with a partial participation a good understanding of the application is required

26 Conceptual / semantic modelling 26 ER diagram - fan trap Student name dOB Course code Project name Attends 1..* 1 Proposes 1..* 1

27 Conceptual / semantic modelling 27 ER diagram - fan trap explanation

28 Conceptual / semantic modelling 28 ER diagram - solution to a fan trap Student name dOB Course hall no Project name Attends Takes 1..* 1 1 can you think of another solution?

29 Conceptual / semantic modelling 29 ER diagram - chasm trap Project name Course hall no Student name dOB Proposes Takes 1..* * 1

30 Conceptual / semantic modelling 30 ER diagram - solution to a chasm trap why not always represent all the relationships? Project name Course hall no Student name dOB Proposes Takes 1..* * 1 Attends 1..*1

31 Conceptual / semantic modelling 31 The Enhanced ER model (EER) additional semantic modelling concepts for richer (more comprehensive) representations type hierarchies specialisation / generalisation subclass / superclass attribute inheritance aggregation hierarchies aggregation composition

32 Conceptual / semantic modelling 32 Specialisation / generalisation equivalent names: specialisation hierarchy, generalisation hierarchy or IS-A hierarchy specialisation identifying classes among the instances of an entity type, by identifying distinguishing properties (attributes); a top down approach generalisation grouping entity types into one single class, by disregarding differentiating properties (attributes) a bottom up approach attribute inheritance

33 Conceptual / semantic modelling 33 Specialisation / generalisation Staff empNo {PK} name salary position Manager experience bonus Developer language projects Support area SalesStaff speciality sales

34 Conceptual / semantic modelling 34 Specialisation / generalisation Staff empNo {PK} name salary position Manager experience bonus Developer language projects Support area SalesStaff speciality sales FullTime notice PartTime workLoad jobLevel

35 Conceptual / semantic modelling 35 Constraints overlapping of the child subclasses disjoint - {OR} overlapping - {AND} participation of the parent superclass total - {Mandatory} partial - {Optional}

36 Conceptual / semantic modelling 36 Constraints Staff empNo {PK} name salary position Manager experience bonus Developer language projects Support area SalesStaff speciality sales FullTime notice PartTime workLoad jobLevel {Optional, OR} {Mandatory, OR}

37 Conceptual / semantic modelling 37 Specialisation / generalisation more than one parent Manager experience bonus SalesStaff speciality sales SalesManager target {Optional} child inherits attributes of both parents

38 Conceptual / semantic modelling 38 Aggregation Course code Module code Staff name Student name dOB Supports IsRegisteredFor 0..* 1..* 0..* *

39 Conceptual / semantic modelling 39 Composition Account no Agreement text date Overdraft dateValidUntil amount Transaction date type amount * *

40 Conceptual / semantic modelling 40 Summary conceptual model ER Model entity attribute relationship multiplicity traps EER model generalisation/specialisation constraints aggregation


Download ppt "Conceptual / semantic modelling 1. 2 Overview design; conceptual design; ER model concepts; semantic aspects; problems; Enhanced ER (EER) modelling; transforming."

Similar presentations


Ads by Google