Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The symbols and vocabulary of the Crow's Foot notation for entity relationship diagrams. It also covers cardinality symbols, comparison of the Crow's Foot notation to the representation of relational tables, important relationship patterns, generalization hierarchies, notational errors in an entity relationship diagram, and the representation of business rules in an entity relationship diagram.
Typology: Slides
1 / 24
Learning Objectives
Entity Relationship Diagrams (ERDs) An entity relationship diagram (ERD) shows the relationships of entity sets stored in a database. ERDs have three basic elements: entity types, relationships, and attributes. Entity Type A collection of entities (persons, places, events, or things) of interest represented by a rectangle in an entity relationship diagram. In the Crow's Foot notation as well as most other notations, rectangles denote entity types. Attribute a property of an entity type or relationship. Each attribute has a data type that defines the kind of values and permissible operations on the attribute. An entity type should have a primary key as well as other descriptive attributes. Attributes are shown inside an entity type rectangle. Relationship A named association among entity types. A relationship represents a two-way or bidirectional association among entities. Most relationships involve two distinct entity types. In the Crow's Foot notation, relationship names appear on the line connecting the entity types involved in the relationship.
Relationship Cardinality
Crow s Foot Representation of Cardinalities The Crow's Foot notation uses three symbols to represent cardinalities. The Crow's Foot symbol (two angled lines and one straight line) denotes many (zero or more) related entities. In following figure the Crow's Foot symbol near the Offering entity type means that a course can be related to many offerings. The circle means a cardinality of zero, while a line perpendicular to the relationship line means a cardinality of one. To depict minimum and maximum cardinalities, the cardinality symbols are placed adjacent to each entity type in a relationship. The minimum cardinality symbol appears toward the relationship name while the maximum cardinality symbol appears toward the entity type. In Figure, a course is related to a minimum of zero offerings (circle in the inside position) and a maximum of many offerings (Crow's Foot in the outside position). Similarly, an offering is related to exactly one (one and only one) course a shown by the single vertical lines in both inside and outside positions.
Classification of Cardinalities
Identification Dependency (Weak Entities and Identifying Relationships) In an ERD, some entity types may not have their own primary key. Entity types without their own primary key must borrow part (or all) of their primary key from other entity types. Entity types that borrow part or their entire primary key are known as weak entities. The relationship(s) that provides components of the primary key is known as an identifying relationship. Thus, an identification dependency involves a weak entity and one or more identifying relationships. Identification dependency occurs because some entities are closely associated with other entities. For example, a room does not have a separate identity from its building because a room is physically contained in a building. You can reference a room only by providing its associated building identifier. In the ERD for buildings and rooms, the Room entity type is identification dependent on the Building entity type in the Contains relationship. A solid relationship line indicates an identifying relationship. For weak entities, the underlined attribute (if present) is part of the primary key, but not the entire primary key. Thus, the primary key of Room is a combination of BldglD and RoomNo.
M-N Relationships with Attributes
Self-Referencing (Unary) Relationships
Associative Entity Types Representing Multiway (M- Way) Relationships
Associative Entity Types Representing Multiway (M- Way) Relationships Although you cannot directly represent M-way relationships in the Crow's Foot notation, you should understand how to indirectly represent them. You use an associative entity type and a collection of identifying 1 - M relationships to represent an M-way relationship. In following Figure, three 1 - M relationships link the associative entity type, Uses, to the Part, the Supplier, and the Project entity types. The Uses entity type is associative because its role is to connect other entity types. Because associative entity types provide a connecting role, they are sometimes given names using active verbs. In addition, associative entity types are always weak as they must borrow the entire primary key. For example, the Uses entity type obtains its primary key through the three identifying relationships.
Equivalence between 1-M and M-N Relationships
Generalization Hierarchies Generalization hierarchies allow entity types to be related by the level of specialization. The following Figure depicts a generalization hierarchy to classify employees as salaried versus hourly. Both salaried and hourly employees are specialized kinds of employees. The Employee entity type is known as the supertype (or parent). The entity types SalaryEmp and HourlyEmp are known as the subtypes (or children). Because each subtype entity is a supertype entity, the relationship between a subtype and supertype is known as ISA. For example, a salaried employee is an employee. Because the relationship name (ISA) is always the same, it is not shown on the diagram. Inheritance supports sharing between a supertype and its subtypes. Because every subtype entity is also a supertype entity, the attributes of the supertype also apply to all subtypes. For example, every entity of SalaryEmp has an employee number, name, and hiring date because it is also an entity of Employee. Inheritance means that the attributes of a supertype are automatically part of its subtypes. That is, each subtype inherits the attributes of its supertype. For example, the attributes of the SalaryEmp entity type are its direct attribute (EmpSalary) and its inherited attributes from Employee (EmpNo, EmpName, EmpHireDate, etc.). Inherited attributes are not shown in an ERD. Whenever you have a subtype, assume that it inherits the attributes from its supertype.
Disjointness and Completeness Constraints Generalization hierarchies do not show cardinalities because they are always the same. Rather disjointness and completeness constraints can be shown. Disjointness means that subtypes in a generalization hierarchy do not have any entities in common. In following Figure, the generalization hierarchy is disjoint because a security cannot be both a stock and a bond. In contrast, the generalization hierarchy in following figure is not disjoint because teaching assistants can be considered both students and faculty. Thus, the set of students overlaps with the set of faculty. Completeness means that every entity of a supertype must be an entity in one of the subtypes in the generalization hierarchy. The completeness constraint in following Figure means that every security must be either a stock or a bond. Some generalization hierarchies lack both disjointness and completeness constraints. In following Figure, the lack of a disjointness constraint means that some employees can be both salaried and hourly. The lack of a completeness constraint indicates that some employees are not paid by salary or the hour (perhaps by commission).
Summary of Crow's Foot Notation
Representation of Business Rules in an ERD As you develop an ERD, you should remember that an ERD contains business rules that enforce organizational policies and promote efficient communication among business stakeholders. An ERD contains important business rules represented as primary keys, relationships, cardinalities, and generalization hierarchies. Primary keys support entity identification, an important requirement in business communication. Identification dependency involves an entity that depends on other entities for identification, a requirement in some business communication. Relationships indicate direct connections among units of business communication. Cardinalities restrict the number of related entities in relationships supporting organizational policies and consistent business communication. Generalization hierarchies with disjointness and completeness constraints support classification of business entities and organizational policies. Thus, the elements of an ERD are crucial for enforcement of organizational policies and efficient business communication.
Diagram Rules
Find all consistency errors in following ERD
Example of Rule Violations and Resolutions
Example of Rule Violations and Resolutions The following list explains the violations:
Example of Rule Violations and Resolutions The following list suggests possible corrective actions for diagram errors:
ERD after removing all consistency errors
Closing Thoughts
Resources
rd
th
th