Introduction to ER Modelling Flashcards
What is the definition of entity
Real-world object distinguishable from other objects.
It is describe using a set of attributes
What is the definition of entity set?
A collection of entities of the same type (e.g all employees)
- All entities in an entity set have the same set of attributes
- Each entity has a key (underlined)
What is the definition of relationship?
Association among two or more entities
- Relationships can have their own attributes
Example: Fred works in the Pharmacy department
What is relationship set?
Collection of relationships of the same type
Example: Employees work in departments
What kind of relationship can an entity set participate in?
Different relationship sets
Different “roles” in the same set
What is the definition of key constraints?
They determine the number of objects taking part in the relationship set
What are the types of key constraints?
Many-to-many
One-to-Many/ Many-to-one
One-to-one
What is an example of many-to-many relationship?
An employee can work in many departments, but a department can have many employees
How is a many-to-many key represented in Chen Notation?
A line
What is a one-to-many relationship?
One-to-many constrains one entity set to have a single entity per a relationship
How is a one-to-many key represented in Chen Notation?
An arrow
How to identify a weak entity?
A weak entity can be identified uniquely only by considering (the primary key of) another (owner) entity
How is a weak entity represented in Chen Notation?
Bold rectangle
How is a weak entity’s partial key represented in Chen Notation?
A dashed underline
What is an owner entity set?
<Policy> and weak entity set [Dependent] must participate in a relationship where each entity has one and only one strong entity to depend on (key constraint)
</Policy>
What is the definition of multi-valued attributes?
Multi-valued attributes can have multiple (finite set of) values of the same type
Example: employees with a home phone number and work phone number
What is the definition of composite attributes?
Composite attributes have a structure hidden inside (each element can be of different type)
Example: Employee address consists of postcode, street name and number
What are the choices to be made in design phase?
- Should a concept be modelled as an entity or an attribute?
- Should a concept be modelled as an entity or a relationship?
- Should we model relationships as binary. ternary, n-ary?
What is an example of Entity vs Attribute
Should “address” be an attribute of Employees or an entity (related to Employees)?
What is the justification or variables to the question:
Should “address” be an attribute of Employees or an entity (related to Employees)?
Depends upon how we want to use address information, and the semantics of the data
- If we have several addresses per employee, address must be an entity - What if an address links to both Employee and WorkFromHomeContract
What is participation constraints
explores whether all entities of one entity set take pat in a relationship
What is total participation?
Total participation says that each entity takes part in “at least one” relationship and is represented by a bold line
Example: Every employee must work in at least one (Total) department. Each department has at least one(Total) employee
What is partial participation?
Partial participation means that not every entity takes part in a relationship
Each department must have one (total) manager (but not everyone is a manager (P =optional)