Chapter 3: ER and EER Models Flashcards
What are the three building blocks of an Entity Relationship Model?
Entity Types, Attribute Types, and Relationship Types
What does ER Model stand for?
Entity Relationship Model
What is an Entity Type?
An entity type is a “thing”, a noun, something that has an unambiguous meaning. Examples include supplier, customer, product, student, etc.
What is the difference between Entity Type and Entity?
An Entity Type is the heading of the table, basically what type of thing (entity) it will contain (ex. Student). An entity is an instance in that table (ex. John Smith)
How is Entity Type depicted in an ER model?
Using a rectangle
What is an Attribute Type?
An attribute type is a property of an entity, it is something about the “thing”. Examples for “Customer” include name, address, customerID, status
How is an Attribute Type depicted in an ER model?
Using an ellipses
What is a Domain?
A Data Domain refers to all the valid values which a data element (column) may contain. You can’t represent domain using an ER model (Ex. gender may only be male or female)
What is a Key Attribute Type?
A Key Attribute Type is used to denote the property that uniquely identifies an entity (customerID), and which is mapped to the Primary Key field in a database
What is the difference between a Simple and Composite Attribute Type?
A Simple Attribute Type cannot be further divided into parts. Examples include supplier numbers or supplier status.
A Composite Attribute Type is one which can be broken down into sup-parts. Examples include address being broken down further into street, number, city, postal code, country, etc.
What is the difference between Single-Valued and Multi-Valued Attribute Types and how are they depicted in an ER model?
A Single-Valued Attribute Type is one that can only have one value, for example, supplierID. A Multi-Valued Attribute Type is one that can have multiple values, for example, multiple email addresses for one supplier.
A Multi-Valued Attribute Type is depicted using a double ellipses
What is a Derived Attribute?
A Derived Attribute is one that is derived from another attribute. An example is Age being derived using the difference between the attribute type Date of Birth and the current date
How is a Relationship Type depicted in an ER model?
Using a rhombus shape (diamond)
What is the Degree of a relationship type?
A Degree is the number of entity types participating in the relationship type
What is Cardinality of relationship types?
Cardinality specifies the minimum or maximum number of relationship instances that an individual entity can participate in
What are the Minimum Cardinalities and what do they mean?
Can either be 0 or 1.
0 means that the entity can occur without being connected through a relationship to another entity
1 means that the entity must always be connected through a relationship to another entity
What are the Maximum Cardinalities and what do they mean?
Can either be 1 or N.
1 means the entity can only be in a relationship with one other entity
N means the entity can be in a relationship with N entities at once
What does 1:1 mean?
Entity A can only be assigned to at most one other entity (a student can have no thesis or one thesis), and Entity B can only be assigned to at most one other entity (a thesis can have no student or one student)
What does 1:N mean?
Entity A can only be assigned to at most one other entity (a project must and can only be managed by one person), but Entity B can be assigned to many other entities at once (a person can manage zero or many projects)
What does N:1 mean?
Entity A can be assigned to many other entities at once, but Entity B can only be assigned to at most one other entity
What does N:M mean?
Entity A can be assigned to many entities at once, N, and Entity B can also have many Entities assigned to it, M. An example is that a student can have many or no classes and a class can have many or no students in it
What is a Strong Entity Type?
A strong entity is complete by itself and is not dependent on any other entity type. It possess a primary key which describes each instance in the strong entity set uniquely
What is a Weak Entity Type? Describe an example.
A Weak Entity is an entity that cannot be uniquely identified by its attributes alone; therefore, it must use a foreign key in conjunction with its attributes to create a primary key
An Example is rooms at a hotel. Entity type “room” cannot be uniquely identified using room number, since all hotels have a room #1, so you must use the hotel number pulled from entity “hotel” as an attribute, making “room” a weak entity
How is a Weak Entity depicted in an ER model? How are borrowed attributes depicted?
A double-lined rectangle for Weak Entity
Dashed underline for borrowed attributes
What is a Ternary Relationship Type?
A Ternary Relationship Type is a relationship type where there are more than two entities engaging in the relationship
What is a limitation of the ER model?
- Temporal constraints cannot be enforced (Ex. after two months, … happens)
- Business rules cannot be enforced (Ex. employees can only work on projects undertaken by the department they are in)
- Domains cannot be set or enforced (Ex. hours worked must be a positive value)
What is the difference between an ER Model and an EER Model?
An EER Model is just an ER Model containing semantic data modeling concepts, which are specialization/generalization, categorization, and aggregation
What are the three extensions to the ER Model that the EER Model provides?
Specialization/Generalization
Categorization
Aggregation
What is Specialization?
Specialization refers to the process of defining a set of subclasses of an entity type. These are formed using distinguishing characteristics of entities in a superclass
Think of it like specializing your business degree. You are part of the business student superclass, but then can specialize into finance, marketing, and supply chain
What is Generalization?
The reverse of specialization, taking subclasses and grouping them into a superclass
For example, there are finance, marketing, and supply chain students, but they can all be considered as business students
What is Disjoint Specialization?
Disjoint Specialization is when an entity can be a member of at most one subclass at a time. A finance student cannot be a supply chain student
What is an Overlap Specialization?
Overlap Specialization is when an entity can be a member of more than one subclass at a time. A university student may be both a business and economics major
What is Total Specialization?
Total Specialization is when every entity in the superclass must be a member of a subclass. Every university student must have a major
What is Partial Specialization?
Partial Specialization allows an entity to be either part of a subclass or not part of a subclass. You can be a university student but not have a minor
What are D.O.T.P specializations? Explain each.
Disjoint Specialization
Overlap Specialization
Total Specialization
Partial Specialization
What is Categorization? How is it represented in an EER diagram?
Categorization is a subclass that has several possible superclasses. For example, a person (superclass) and a company (superclass) may be of the subclass account holders
What is Total Categorization and Partial Categorization?
Total Categorization is when all entities of a superclass belong to a subclass. Partial Categorization is when not all entities of a superclass belong to the subclass
For example, not all companies and people are account holders
What is Aggregation? Give an example.
Aggregation is when entity types are related by a particular relationship and are aggregated into a higher-level entity type that has a relationship with other entity types
An example is the entity types “project” and “employee”, which have a “works for” relationship, which can be aggregated and then related to a required machinery