Presentation is loading. Please wait.

Presentation is loading. Please wait.

Entity-Relation Modeling

Similar presentations


Presentation on theme: "Entity-Relation Modeling"— Presentation transcript:

1 Entity-Relation Modeling
Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International University of Japan

2 Outline Business Rules Entity-Relation Model Entity of E-R Model
Attribute of E-R Model Relationship of E-R Model Degree of Relationship Cardinality of a Relationship CASE Tools

3

4 4 Business Rules “A statement that defines or constrains some aspect of the business” “Govern how data are handled and stored” “Derived from policies, procedures, events, functions, and other business objects” “Documenting rules and policies of an organization that govern data is exactly what data modeling is all about.”

5 Entity-Relationship Model
5 Entity-Relationship Model A database modeling method that produces “a detailed, logical representation of the data” Produces a conceptual schema in a relational database Introduced by Peter Chen in 1976 Represented by entity-relationship diagram (ERD)

6 Entity-Relationship Diagram
6 Entity-Relationship Diagram E-R diagram (ERD) represents the abstract and conceptual relationships in ERM. Components of ERD Entity with attributes Relationship among entities Cardinality

7 Entity of E-R Model 1 Represented by a rectangle or box in ERD
7 Entity of E-R Model 1 Represented by a rectangle or box in ERD Name in uppercase Name as singular noun form Includes a set of attributes Entity type versus entity instance

8 8 Entity of E-R Model 2 Entity type is “a collection of entities that share common properties” Entity instance is “a single occurrence of an entity type” Strong (unique/independent) entity type versus weak (dependent) entity type

9 9 Entity of E-R Model 3 Associative entity, bridge/intermediary/intersection/junction/link ing/mapping table, many-to-many solver Associate the instances of entity types Contains attributes that are peculiar to the relationship among the entity instances. Relationship in a rectangular with rounded corners or dashed line

10 10 Strong Relationship 1 A strong (identifying) relationship exists “when the primary key of the related entity contains a primary key component of the parent entity” (p.331) It is represented by a solid line. The relationship between COURSE and CLASS tables below is strong because, Crs_code in CLASS (child entity in the 1:M relationship) inherits a primary key component from COURSE (parent entity).

11 11 Strong Relationship 2

12 12 Weak Relationship 1 A weak (non-identifying) relationship exists “if the primary key of the related entity does not contain a primary key component of the parent entity” (p.330). It is represented by a dashed line. In the following example, Crs_code in CLASS (child entity) is not a part of primary key and does not inherit a primary key component from COURSE (parent entity). Note that Crs_code in CLASS is a foreign key.

13 13 Weak Relationship 2

14 Attribute of E-R Model 1 A property of an entity type
14 Attribute of E-R Model 1 A property of an entity type Singular none or none phrase Sentence-cased Required (must have values) in boldface v.s. optional attribute (may not)

15 15 Attribute of E-R Model 2 Simple (atomic) attribute v. s. composite attribute (having meaningful components parts such as last name and first name) in (…) Single-valued v.s. multi-valued attribute in {…} Stored v.s. derived attribute (e.g., age calculated from date of birth) in […]

16 Relationship of E-R Model 1
16 Relationship of E-R Model 1 Connectivity (association) representing an interaction among instances of entity types Relationship type is “a meaningful association among entity types” Relationship instance is “an association among entity instances

17 Relationship of E-R Model 2
17 Relationship of E-R Model 2 Represented by a diamond in the original Chen notation and by a connecting line Connectivity label (name) is a verb phrase in sentence-case Either an active or passive form (e.g., manages or managed by)

18 Degree of a Relationship 1
18 Degree of a Relationship 1 The number of entity types that participate in a relationship. Unary (recursive) relationship is a relationship between the instances of one entity type Examples are marriage and supervision in an organization

19 Degree of a Relationship 2
19 Degree of a Relationship 2 Binary relationship is a relationship between instances of two entity types. Binary relationship is most common Ternary relationship is a simultaneous relationship among instances of three entity types.

20

21 Cardinality (Constraint) 1
21 Cardinality (Constraint) 1 “The number of instances of entity B that can (or must) be associated with each instance of entity A” Cardinality of a relationship expresses the minimum and maximum number of entity occurrences associated with one occurrence of the related entity.

22 Cardinality (Constraint) 2
22 Cardinality (Constraint) 2 Minimum cardinality: minimum number of instances of entity B that may be associated with each instance of entity A Maximum cardinality: maximum number of instances of entity B that may be associated with each instance of entity A Zero (0) cardinality implies “optional,” cardinality one (1) means “mandatory”

23 Cardinality (Constraint) 3
23 Cardinality (Constraint) 3 (0,1) zero minimum or one maximum; optional (1,1) one and only one; mandatory (0, N) one or many; optional (1,N) one or many; mandatory Symbols are used instead of numbers in ERD

24 24

25 25

26

27 27 CASE Tools CASE tools are very useful in system design and development stage, facilitating communications among stakeholders. Professional CASE tools, CaseStudio II, Microsoft Visio (Professional Edition) MySql Workbench h/

28 An Example of CASE Tools
28 An Example of CASE Tools MySql Workbench GUI Provides flexible ways to modify. Define the database structure that matches with the E-R diagram Generate SQL commands to create corresponding tables based on E-R diagram designed.

29 E-R Diagram (CaseStudio 2)

30 30

31 31

32 References Hoffer, Jeffrey A., V. Ramesh, and Heikki Topi Modern database management, 10th ed. Pearson Education.


Download ppt "Entity-Relation Modeling"

Similar presentations


Ads by Google