Chapter 3 data modeling using the entity relationship er model

chapter 3 data modeling using the entity relationship er model

Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3). Out lines ER Diagram: Entities Attributes Keys Weak entity Domain Relationship Roles Degrees of relationships Cardinalities Multiplicity Participation. Data Modeling Using the. Entity-Relationship Model. Chapter 3. 2. Chapter 3. 3. Entity-Relationship(ER) Model. The ER model is a high-level conceptual data.

Multi-valued An entity may have multiple values for that attribute. College, Year, Degree, Field 10 Slide 3- 10 Example of a composite attribute 11 Slide 3- 11 Entity Types and Key Attributes 1 Entities with the same basic attributes are grouped or typed into an entity type.

chapter 3 data modeling using the entity relationship er model

An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type. An entity type may have more than one key. The CAR entity type may have two keys: Entities and their entity types and entity sets Attributes simple, composite, multivalued Relationships and their relationship types and relationship sets We introduce relationship concepts next 19 Slide 3- 19 Relationships and Relationship Types 1 A relationship relates two or more distinct entities with a specific meaning.

Relationships of the same type are grouped or typed into a relationship type. The degree of a relationship type is the number of participating entity types.

Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model. - ppt download

Is the schema description of a relationship Identifies the relationship name and the participating entity types Also identifies certain relationship constraints Relationship Set: The current set of relationship instances represented in the database The current state of a relationship type 23 Slide 3- 23 Relationship type vs.

Diamond-shaped box is used to display a relationship type Connected to the participating entity types via straight lines 24 Slide 3- 24 Refining the COMPANY database schema by introducing relationships By examining the requirements, six relationship types are identified All are binary relationships degree 2 Listed below with their participating entity types: One employee in supervisor role One employee in supervisee role 28 Slide 3- 28 Weak Entity Types An entity that does not have a key attribute A weak entity must participate in an identifying relationship type with an owner or identifying entity type Entities are identified by the combination of: A partial key of the weak entity type The particular entity they are related to in the identifying entity type Example: N or Many-to-one N: N Existence Dependency Constraint specifies minimum participation also called participation constraint zero optional participation, not existence-dependent one or more mandatory participation, existence-dependent 30 Slide 3- 30 Many-to-one N: N Relationship 32 Slide 3- 32 Displaying a recursive relationship In a recursive relationship type.

Both participations are same entity type in different roles. In following figure, first role participation labeled with 1 and second role participation labeled with 2.

chapter 3 data modeling using the entity relationship er model

Weak entity may have no key. Has the following criteria: Should not change its value Not null Avoid intelligent keys. Substitute large composite keys with surrogate keys system generated keys for unique numbers. It has a PK. A weak entity type is an entity type that is existence- dependent on some other entity type. It does not have a PK. The PK of a weak entity set is formed by the PK of its strong entity type, plus a weak entity type discriminator attribute Partial key.

R among n entity types E1,E2,…En defines a set of associations among entities from these types. Each entity type participates in the relationship type R.

Relationships may have attributes. More than one relationship can exist with the same entity types.

Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.

A relationship of degree one 1 entity types is unary recursive. A relationship of degree two 2 entity types are binary. A relationship of degree three 3 entity types are ternary. It is a unary relationship.

Chapter -3- Data Modeling Using the Entity- Relationship Model

Has the degree 1 require 30 Degree of Relationship Type A relationship of degree two 2 entity types are binary. N or Many-to-one N: Most useful in describing binary relationship types.

For a binary relationship type the mapping cardinality must be one of the following types: M — Many to one M: Specified on each participation of an entity type E in a relationship type R Specifies that each entity e in E participates in at least min and at most max relationship instances in R Default no constraint: