Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief

Similar presentations


Presentation on theme: "1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief"— Presentation transcript:

1 1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief http://arief.ismy.web.id

2 2 Database Design u Approaches include: –Bottom-up »Attributes  Relation, Entities –Top-down »Relation, Entities  Attributes –Inside-out »Attributes  Major entities  Other entities –Mixed http://arief.ismy.web.id

3 3 Chapter 11 - Objectives u How to use Entity–Relationship (ER) modeling in database design. u Basic concepts associated with ER model. u Diagrammatic technique for displaying ER model using Unified Modeling Language (UML). http://arief.ismy.web.id

4 4 ER Diagram of Branch View of DreamHome http://arief.ismy.web.id

5 5 Concepts of the ER Model u Entity types u Relationship types u Attributes http://arief.ismy.web.id

6 6 Entity Type u Entity type –Group of “objects” with same properties, identified by enterprise as having an independent existence. u Object - something that is or is capable of being seen, touched, or otherwise sensed, and about which users store data and associate behavior. u Entity occurrence –Uniquely identifiable object of an entity type. http://arief.ismy.web.id

7 7 Examples of Entity Types http://arief.ismy.web.id

8 8 Example of entity occurrence Student IDLast NameFirst Name 2144ArnoldBetty 3122TaylorJohn 3843SimmonsLisa 9844MacyBill 2837LeathHeather 2293WrenchTim Entity occurrence Entity: student http://arief.ismy.web.id

9 9 ER Diagram of Staff and Branch Entity Types UML: First letter of each word is in upper case Ex. PropertyForRent http://arief.ismy.web.id

10 10 Relationship Types u Relationship type –Set of meaningful associations among entity types. u Relationship occurrence –Uniquely identifiable association, which includes one occurrence from each participating entity type. http://arief.ismy.web.id

11 11 Semantic Net of Has Relationship Type http://arief.ismy.web.id

12 12 ER Diagram of Branch Has Staff Relationship UML: - First letter of each word is in upper case Ex. LeasedBy - Use arrow symbol http://arief.ismy.web.id

13 13 Relationship Types u Degree of a Relationship –Number of participating entities in relationship. u Relationship of degree: –two is binary; –three is ternary; –four is quaternary. http://arief.ismy.web.id

14 14 Binary Relationship called POwns http://arief.ismy.web.id

15 15 Ternary Relationship called Registers Other example: Project, Location, Employee, Assignment http://arief.ismy.web.id

16 16 Quaternary Relationship called Arranges http://arief.ismy.web.id

17 17 Relationship Types u Recursive Relationship –Relationship type where same entity type participates more than once in different roles  unary relationship. u Relationships may be given role names to indicate purpose that each participating entity type plays in a relationship. http://arief.ismy.web.id

18 18 Recursive Relationship called Supervises with Role Names http://arief.ismy.web.id

19 19 Other example of Recursive Relationship http://arief.ismy.web.id

20 20 Entities associated through two distinct Relationships with Role Names http://arief.ismy.web.id

21 21 Attributes u Attribute –Property of an entity or a relationship type. »UML: first letter of first word is in lower case, first letter of other words is in upper case u Attribute Domain –Set of allowable values for one or more attributes. http://arief.ismy.web.id

22 22 Attributes u Simple Attribute –Attribute composed of a single component with an independent existence. »Ex. position, salary u Composite Attribute –Attribute composed of multiple components, each with an independent existence. »Ex. address: street+city+postcode http://arief.ismy.web.id

23 23 Attributes u Single-valued Attribute –Attribute that holds a single value for each occurrence of an entity type. »Ex. branchNo u Multi-valued Attribute –Attribute that holds multiple values for each occurrence of an entity type. »Ex. UML: telNo [1..3] http://arief.ismy.web.id

24 24 Attributes u Derived Attribute –Attribute that represents a value that is derivable from value of a related attribute, or set of attributes, not necessarily in the same entity type. »Ex. /leasedDuration= rentStart – rentFinish UML: /totalSalary, /totalStaff http://arief.ismy.web.id

25 25 Keys u Candidate Key –Minimal set of attributes that uniquely identifies each occurrence of an entity type. u Primary Key –Candidate key selected to uniquely identify each occurrence of an entity type. »UML: branchNo {PK} u Composite Key –A candidate key that consists of two or more attributes. »Ex. Advert(propertyNo, newspaperName, dateAdvert, cost) Composite key: propertyNo+newspaperName,+dateAdvert http://arief.ismy.web.id

26 26 ER Diagram of Staff and Branch Entities and their Attributes http://arief.ismy.web.id

27 27 Entity Type u Strong Entity Type (parent) –Entity type that is not existence-dependent on some other entity type. OR –Each participating entity has its own independent primary key. u Weak Entity Type (child) –Entity type that is existence-dependent on some other entity type. OR –The parent entity’ key is also part of the primary key of the child entity. http://arief.ismy.web.id

28 28 Strong Entity Type called Client and Weak Entity Type called Preference http://arief.ismy.web.id

29 29 Strong and Weak Entity Weak Entity Strong Entity http://arief.ismy.web.id

30 30 Strong and Weak Entity http://arief.ismy.web.id

31 31 Relationship called Advertises with Attributes Indicate that that the relationship conceals unidentified entity type http://arief.ismy.web.id

32 32 Structural Constraints u Main type of constraint on relationships is called multiplicity. u Multiplicity - number (or range) of possible occurrences of an entity type that may relate to a single occurrence of an associated entity type through a particular relationship. u Represents policies (called business rules) established by user or company. http://arief.ismy.web.id

33 33 Structural Constraints u The most common degree for relationships is binary. u Binary relationships are generally referred to as being: –one-to-one (1:1) –one-to-many (1:*) –many-to-many (*:*) http://arief.ismy.web.id

34 34 Semantic Net of Staff Manages Branch Relationship Type http://arief.ismy.web.id

35 35 Multiplicity of Staff Manages Branch (1:1) Relationship Type http://arief.ismy.web.id

36 36 Semantic Net of Staff Oversees PropertyForRent Relationship Type http://arief.ismy.web.id

37 37 Multiplicity of Staff Oversees PropertyForRent (1:*) Relationship Type http://arief.ismy.web.id

38 38 Semantic Net of Newspaper Advertises PropertyForRent Relationship Type http://arief.ismy.web.id

39 39 Multiplicity of Newspaper Advertises PropertyForRent (*:*) Relationship http://arief.ismy.web.id

40 40 Structural Constraints u Multiplicity for Complex Relationships –Number (or range) of possible occurrences of an entity type in an n-ary relationship when other (n-1) values are fixed. http://arief.ismy.web.id

41 41 Semantic Net of Ternary Registers Relationship with Values for Staff and Branch Entities Fixed http://arief.ismy.web.id

42 42 CR56/B003 CR57/B003 CR62/B003 CR84/B003 CR91/B003 r1 r2 r3 r4 r5 SG37 SG5 SG14 http://arief.ismy.web.id

43 43 Multiplicity of Ternary Registers Relationship http://arief.ismy.web.id

44 44 Summary of Multiplicity Constraints http://arief.ismy.web.id

45 45 Structural Constraints u Multiplicity is made up of two types of restrictions on relationships: cardinality and participation. u Cardinality –Describes maximum number of possible relationship occurrences for an entity participating in a given relationship type. u Participation –Determines whether all or only some entity occurrences participate in a relationship. http://arief.ismy.web.id

46 46 Multiplicity as Cardinality and Participation Constraints http://arief.ismy.web.id

47 47 http://arief.ismy.web.id

48 48 http://arief.ismy.web.id

49 49 Introduction to the UML Unified Modeling Language (UML) – a set of modeling conventions that is used to specify or describe a software system in terms of objects. – The UML does not prescribe a method for developing systems—only a notation that is now widely accepted as a standard for object modeling. http://arief.ismy.web.id


Download ppt "1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief"

Similar presentations


Ads by Google