Entity Relationship Model Flashcards
What is the ER model? Why do we need one?
An object data model.
We need one to provide a unified way in which all users can interpret the database.
What are the 4 components of the ER model?
Entities, Relationships, Attributes, Constraints.
What are the 2 categories of entities?
Entity Type - A collection of entity instances with the same attributes. For example, student.
Entity Instance - An instances of an entity type. For example, Jason in Student.
What is a relationship? What are the different types?
A relationship is a meaningful association between entity types.
Relationships can be recursive, binary, ternary etc.
What is the degree of a relationship?
The number of entities that a relationship associates.
What are attributes? What are the different types of attributes?
Attributes are properties of the entity.
Singular - Singular attribute that holds a value.
Composite - Attribute that consists of multiple nested attributes.
Derived - Attribute that is the result of an operation on two or more attributes.
Multi-valued - Attribute that holds more than one value.
What is the domain of an attribute?
All the possible values that the attribute can hold.
Define the main constraint in ER models?
Multiplicity. This represents the number of entities that a certain entity can relate to.
What is the purpose of keys in the ER model?
To enable unique identification of any entity instance in a table.
What are the 4 types of key?
Candidate Key - The set of all keys.
Primary Key - The chosen key to uniquely identify any given entity.
Composite Key - A combination of 2 candidate keys.
Alternate Key - The set of candidate keys minus the primary key.
Why is it sometimes necessary to give a relationship attributes?
To avoid conflicts between primary keys of 2 entities.
Do relationships have keys?
No.
Define the 2 types of entites?
Strong entity - Can exist independently.
Weak entity - Existence relies on another entity.
Define multiplicity
A structural constraint that represents the number of entity instances that any given entity instance can relate to.
What are the 3 types of multiplicity?
one to one, one to many, many to many.