1 Entity-Relationship Modelling – Part 1 In this chapter, you will learn: • ER Diagrams – Crow Feet & Chen Notations • The main characteristics of entity relationship components – Entity – Attributes • Primary keys • Composite primary keys • Composite and simple attributes • Single-valued attributes • Multivalued attributes – Relationships • 1:M relationship • 1:1 relationship • M:N relationship 2 The Entity Relationship (ER) Model • ER model forms the basis of an ER diagrams (Crow Feet Notation & Chen Notation) • ERD represents conceptual database as viewed by end user • ERDs depict database’s main components: – Entities – Attributes – Relationships 3 Entities • Refers to entity set and not to single entity occurrence • Corresponds to table and not to row in relational environment • In both Chen and Crow’s Foot models, entity is represented by rectangle containing entity’s name • Entity name, a noun, is usually written in capital letters 4 Attributes • Characteristics of entities • In Chen model, attributes are represented by ovals and are connected to entity rectangle with a line • Each oval contains the name of attribute it represents • In Crow’s Foot model, attributes are written in attribute box below entity rectangle 5 Composite and Simple Attributes • Composite attribute (NOT composite key) can be subdivided to yield additional attributes. – an ADDRESS attribute can be subdivided into city, state and postcode – NAME attribute can be subdivided into first_Name and Last_Name • Simple attribute cannot be subdivided. Ex. AGE, MARITAL STATUS 6
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Entity-Relationship Modelling –Part 1
In this chapter, you will learn:
• ER Diagrams – Crow Feet & Chen Notations
• The main characteristics of entity relationship components
– Entity
– Attributes
• Primary keys
• Composite primary keys
• Composite and simple attributes
• Single-valued attributes
• Multivalued attributes
– Relationships
• 1:M relationship
• 1:1 relationship
• M:N relationship
2
The Entity Relationship (ER) Model
• ER model forms the basis of an ER diagrams (Crow Feet Notation & Chen Notation)
• ERD represents conceptual database as viewed by end user
• ERDs depict database’s main components:
– Entities
– Attributes
– Relationships
3
Entities
• Refers to entity set and not to single entity occurrence
• Corresponds to table and not to row in relational environment
• In both Chen and Crow’s Foot models, entity is represented by rectangle containing entity’s name
• Entity name, a noun, is usually written in capital letters
4
Attributes
• Characteristics of entities
• In Chen model, attributes are represented by ovals and are connected to entity rectangle with a line
• Each oval contains the name of attribute it represents
• In Crow’s Foot model, attributes are written in attribute box below entity rectangle
5
Composite and Simple Attributes
• Composite attribute (NOT composite key) can be subdivided to yield additional attributes.
– an ADDRESS attribute can be subdivided into city,
state and postcode
– NAME attribute can be subdivided into first_Name and Last_Name
• Simple attribute cannot be subdivided.
Ex. AGE, MARITAL STATUS
6
2
Single-Valued Attributes
• Single-value attribute can have only a single value
Ex. CAR_MODEL_NO
• Not necessarily a simple attribute
Ex. IC_NUM => 780417-08-5284
is a composite attribute because it can be subdivided into birthdate (780417), place of birth (08), serial number (5284)
7
Multivalued Attributes
Multivalued attributes can have many values
Ex. A car color may be subdivided into many colors (colors for the roof, body and trim)
Chen Model, the multivalued attributes are shown by double line connecting the attribute to the entity.
Multivalued Attributes (continued)
8
Resolving Multivalued Attribute Problems
• Although conceptual model can handle M:N relationships and multivalued attributes, you should not implement them in relational DBMS
– Option 1: Within original entity, create several new attributes, one for each of the original multivalued attribute’s components
• Can lead to major structural problems in table
– Option 2: Create new entity composed of original multivalued attribute’s components