Podcast
Questions and Answers
In Barker's notation for Entity Relationship Diagrams (ERDs), what shape is used to represent an entity?
In Barker's notation for Entity Relationship Diagrams (ERDs), what shape is used to represent an entity?
- Circle
- Rounded corner rectangle (correct)
- Rectangle with sharp corners
- Oval
In ERDs, what does a Unique Identifier (UID) primarily signify?
In ERDs, what does a Unique Identifier (UID) primarily signify?
- An attribute that can have null values
- An attribute uniquely identifying an entity instance, implemented as a Primary Key (correct)
- An attribute whose value is derived from other attributes
- An attribute that describes the possible relationships with other entities
What does a mandatory relationship indicate in an Entity Relationship Diagram?
What does a mandatory relationship indicate in an Entity Relationship Diagram?
- That the relationship is used to resolve many-to-many cardinality
- That the relationship can be derived from other relationships
- That each instance of an entity must be related to another instance (correct)
- That participation in the relationship is optional for both entities
What is the purpose of labeling the perspectives of a relationship in an ERD?
What is the purpose of labeling the perspectives of a relationship in an ERD?
Which of the following best describes the term 'degree of a relationship' in ER modeling?
Which of the following best describes the term 'degree of a relationship' in ER modeling?
Why is a many-to-many relationship generally avoided in a relational database design?
Why is a many-to-many relationship generally avoided in a relational database design?
In the context of resolving many-to-many relationships, what is the role of the intermediary or transactional entity?
In the context of resolving many-to-many relationships, what is the role of the intermediary or transactional entity?
What does the UID Bar added to the perspectives of the intermediary entity in a resolved many-to-many relationship signify?
What does the UID Bar added to the perspectives of the intermediary entity in a resolved many-to-many relationship signify?
How is a recursive relationship typically implemented in a database?
How is a recursive relationship typically implemented in a database?
What is a redundant relationship in ER modeling and why should it be removed?
What is a redundant relationship in ER modeling and why should it be removed?
What is a 'composed UID attribute' in ER modeling?
What is a 'composed UID attribute' in ER modeling?
What is the key characteristic of a 'composed cascade UID attribute'?
What is the key characteristic of a 'composed cascade UID attribute'?
What is the primary purpose of using entity subtypes in ER modeling?
What is the primary purpose of using entity subtypes in ER modeling?
What does the 'Exhaustive Rule' state in the context of entity subtypes?
What does the 'Exhaustive Rule' state in the context of entity subtypes?
What does the 'Mutually Exclusive Rule' state in the context of entity subtypes?
What does the 'Mutually Exclusive Rule' state in the context of entity subtypes?
When should an exclusive relationship arc be used instead of subtypes?
When should an exclusive relationship arc be used instead of subtypes?
What is the primary purpose of an exclusive relationship arc in ER modeling?
What is the primary purpose of an exclusive relationship arc in ER modeling?
Where are the foreign keys placed when implementing an exclusive relationship arc?
Where are the foreign keys placed when implementing an exclusive relationship arc?
What kind of constraint is applied when implementing an exclusive relationship arc?
What kind of constraint is applied when implementing an exclusive relationship arc?
In the context of ER modeling, what does 'Non-Transferability of Relationships' mean?
In the context of ER modeling, what does 'Non-Transferability of Relationships' mean?
How is non-transferability of a relationship enforced at the database level?
How is non-transferability of a relationship enforced at the database level?
Which symbol indicates non-transferability in a relationship in ER modeling?
Which symbol indicates non-transferability in a relationship in ER modeling?
Where should the diamond symbol for non-transferability be placed in a relationship?
Where should the diamond symbol for non-transferability be placed in a relationship?
According to general rules of ERDs, how many times should information appear in a diagram?
According to general rules of ERDs, how many times should information appear in a diagram?
According to general rules of ERDs, how should derivable information be treated?
According to general rules of ERDs, how should derivable information be treated?
What consideration should be prioritized when determining where to place the foreign key in a 1:1 relationship?
What consideration should be prioritized when determining where to place the foreign key in a 1:1 relationship?
What is the appropriate action when a subtype lacks unique attributes or relationships?
What is the appropriate action when a subtype lacks unique attributes or relationships?
What is the key step for drawing an exclusive relationship arc?
What is the key step for drawing an exclusive relationship arc?
When drawing attributes in an ERD, what should guide the naming of attributes?
When drawing attributes in an ERD, what should guide the naming of attributes?
What is the primary goal of data modeling?
What is the primary goal of data modeling?
In a one-to-many (1:M) relationship, where is the foreign key typically placed?
In a one-to-many (1:M) relationship, where is the foreign key typically placed?
When should an ER modeler be concerned about physical implementation details like foreign keys?
When should an ER modeler be concerned about physical implementation details like foreign keys?
What is an optional attribute?
What is an optional attribute?
Flashcards
Data Model
Data Model
A graphical representation of the solution to a problem as adopted by a particular community.
Entity Relationship Diagram (ERD)
Entity Relationship Diagram (ERD)
A logical diagram representing the database structure using the relational model.
General Rules of ERDs
General Rules of ERDs
- Capture all required information. 2. Information appears only once. 3. Model no derivable information. 4. Information is in a predictable, logical place.
Entity
Entity
Signup and view all the flashcards
Attribute
Attribute
Signup and view all the flashcards
Unique Identifier (UID)
Unique Identifier (UID)
Signup and view all the flashcards
Mandatory Attribute
Mandatory Attribute
Signup and view all the flashcards
Optional Attribute
Optional Attribute
Signup and view all the flashcards
Relationship
Relationship
Signup and view all the flashcards
Mandatory Relationship
Mandatory Relationship
Signup and view all the flashcards
Optional Relationship
Optional Relationship
Signup and view all the flashcards
First Perspective / A Perspective
First Perspective / A Perspective
Signup and view all the flashcards
Second Perspective / B Perspective
Second Perspective / B Perspective
Signup and view all the flashcards
One-to-One Relationship (1:1)
One-to-One Relationship (1:1)
Signup and view all the flashcards
One-to-Many Relationship (1:M)
One-to-Many Relationship (1:M)
Signup and view all the flashcards
Many-to-Many Relationship (M:M)
Many-to-Many Relationship (M:M)
Signup and view all the flashcards
UID Bar
UID Bar
Signup and view all the flashcards
Recursive Relationships
Recursive Relationships
Signup and view all the flashcards
Redundant Relationships
Redundant Relationships
Signup and view all the flashcards
Composed Cascade UID Attribute
Composed Cascade UID Attribute
Signup and view all the flashcards
Entity Subtypes
Entity Subtypes
Signup and view all the flashcards
Exhaustive Rule
Exhaustive Rule
Signup and view all the flashcards
Mutually Exclusive Rule
Mutually Exclusive Rule
Signup and view all the flashcards
Exclusive Relationship Arc
Exclusive Relationship Arc
Signup and view all the flashcards
Non-Transferability of Relationships
Non-Transferability of Relationships
Signup and view all the flashcards
Single UID Attribute
Single UID Attribute
Signup and view all the flashcards
Multiple UID Attribute
Multiple UID Attribute
Signup and view all the flashcards
Composed UID Attribute
Composed UID Attribute
Signup and view all the flashcards
Study Notes
ERD Modeling Introduction
- This document serves as a guide to Entity Relationship Modeling using Barker's notation.
- The document is intended for database designers, educators, and learners.
- The intention is to portray a method and approach of explaining topics while showcasing an understanding of such topics.
Modeling
- A data model is a graphical representation of the solution to a problem as adopted by a particular community.
- Different communities trying to resolve the same problem can produce different yet valid solutions.
- An Entity Relationship Diagram is a logical diagram representing the database structure using the relational model.
- Barker's notation is adopted.
ERD Rules
- Capture all required information.
- Information appears only once.
- Model no information that is derivable from other information already modelled.
- Information is in a predictable, logical place.
ERD Concepts
- ERDs use three concepts: Entities, Attributes and Relationships
Entities
- An entity is an object that a community feels is important to include.
- Other communities trying to solve the same problem might depreciate the entity to an attribute or omit it.
- An entity would transmit to a table in a database.
- An entity instance is a record within a table.
- For example, in a CD database, entities such as CD are expected.
Attributes
– An attribute is a property of an entity describing instance characteristics.
- Attributes can be:
- Unique Identifier (UID): uniquely identifies an entity instance and is implemented as a Primary Key.
- Mandatory Attribute: must have a value (cannot be null).
- Optional Attribute: value can be null.
Relationships
- A relationship links two or more entity instances together.
- A relationship is implemented as a Foreign Key and therefore the FK attribute is not listed as an attribute in the target entity.
Drawing Entities
- An entity is represented by a rounded corner rectangle.
- The entity name is placed inside the rectangle at the top.
- Entity names should be in upper case and in singular form.
Drawing Attributes
- Attributes should be written in a way that is understandable and meaningful.
- The first letter of each word in an attribute should be in upper case with the rest in lower case.
- A symbol represents the type of attribute.
Drawing Relationships
- A relationship exists between a maximum of two entities.
- A relationship can exist on the same entity.
- A relationship has two perspectives that must be labelled.
- When drawing a relationship:
- Determine the entities affected.
- Determine the optionality.
- Determine the degree.
- Label the perspectives.
Optionality of Relationships
- Mandatory Relationship: Each instance from an entity must be related to another instance; represented by a straight line.
- Optional Relationship: Each instance from an entity may be related to another instance; represented by a dashed line.
Relationship Perspectives
- A relationship is always made up of two perspectives using the following notation:
- First Perspective / A Perspective: Each A must label a one or more Bs
- Second Perspective / B Perspective: Each B may label b exactly one A.
Labelling Relationships
- A label is applied for each perspective, and should be a verb in lower case form.
- The label is positioned according to the diagram shown, and should be relevant to the scenario.
Degree of a Relationship
- A relationship can be one of three types:
- One-to-One Relationship (1:1): Each entity instance is related to just one entity instance.
- One-to-Many Relationship (1:M): Each entity instance is related to multiple entity instances.
- Many-to-Many Relationship (M:M): This type of relationship is never required and needs to be resolved.
Steps in Resolving Many-to-Many Relationships
- Create a third/intermediary/transactional entity (AB).
- Add two one-to-many relationships from the original entities to the new entity (A to AB, B to AB).
- The optionality from the AB perspective should always be mandatory.
- The optionality of the remaining perspectives is derived from the original many-to-many relationship.
- UID Bars are added to the AB perspectives, indicating that the foreign keys are also primary keys.
UID Bar concept
- Foreign key is also part of a primary key, generally a composite key.
- To solve this issue, add the UID Bar to the ORDER ITEM perspectives.
- Each individual UID Bar represents the fact that the foreign key represented by the relationship is also a primary key of the entity to which the perspective belongs.
Recursive Relationships
- A relationship acts upon the same entity
- This type of relationship is called a recursive relationship and is generally implemented by having a foreign key referring to the primary key of the same entity.
Redundant Relationships
- The information represented by a relationship can be derived from other information already represented in an ERD.
- This relationship is called a redundant relationship and needs to be removed.
UID Attributes
- There are four types of Unique Identifier attributes which are implemented as primary keys:
- Single UID Attribute: An entity is made up of only one UID attribute which is not a foreign key.
- Multiple UID Attribute: A primary key is made up of multiple attributes (composite primary key) all of which are non-foreign keys.
- Composed UID Attribute: An entity has a primary key which is also a foreign key. These are marked with a UID Bar.
- Composed Cascade UID Attribute: An entity uses its foreign keys as primary keys from an entity with composed UID attributes.
Entity Subtypes
- Different entities are grouped together under one common entity called a super type entity whilst the nested entities would be the subtype entities.
Entity Subtypes Rules
- Exhaustive Rule: Every entity instance of the super type must be an instance of one of the subtypes.
- Mutually Exclusive Rule: Every entity instance of the super type can be an instance of only one entity subtype and not the other.
Drawing subtypes guidelines
- Each subtype is a specialisation of a super type and therefore must be enclosed within an entity.
- The common attributes and relationships for all subtypes must be listed in the super type only but are inherited in every subtype.
- A subtype can and would generally have attributes and relationships of its own.
- There can never be just one subtype; another subtype should be created to cater for the rest.
- If none of the subtypes have any unique attributes or relationships then it is not recommended to make use of subtypes but rather create a separate entity containing a list of the various types required.
Implementing a subtype
- There are various methods of implementing a subtype but the preferred method is as follows:
- Create a table for the super type with all common attributes and relationships.
- Create a separate table for each subtype.
- In the subtypes include the specific attributes and relationships.
- Create a foreign key in the super type for each subtype.
- Impose a constraint that only one foreign key may not be null.
- Impose a constraint that at least one foreign key must not be null.
Exclusive Relationship Arc
- An entity is either related to one entity or to another but not both. Whenever a selection needs to be done between relationships, an exclusive relationship arc is created.
Rules of the exclusive relationship arc
- A relationship arc may be applied to only one entity, called the target entity.
- The relationship arc must be applied to a minimum number of two relationships.
- The target entity will contain the foreign keys of the relationships affected by the arc.
- The optionality of the relationships affected by the arc must be the same from the perspective of the target entity.
- The optionality of the relationships affected by the arc may be different from the perspectives of the source entities.
- The relationships affect by the arc may be have a different cardinality (one-to-one, one-to-many).
Drawing an exclusive relationship arc
- To design an exclusive relationship arc the following steps need to be taken:
- Determine the owner of the relationship arc.
- Draw an arc across the relationships to be affect and around the entity that owns the arc.
- Circle the crossed relationships that are to be affected.
Implementing an exclusive relationship arc
- To implement an exclusive relationship arc the following steps need to be done:
- Create a foreign key for each relationship affected by the arc. The foreign keys must be placed in the entity to which the arc belongs to.
- Implement a constraint that allows only one foreign key value not to be null.
Non-Transferability of Relationships
- In certain situations once a relationship is set it can never change. It is called the non-transferability of a relationship.
Drawing Non-Transferability
- When drawing the non-transferability of a relationship the following rules need to be respected:
- The diamond symbol should be on the perspective where the foreign key will be implemented.
- The non-transferability symbol should be displayed only once per relationship provided that any many-to-many relationships have been resolved.
Implementation of Non-Transferability
- When implementing the non-transferability of a relationship a constraint is applied to the foreign key which does not allow the values to be updated.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.