Lecture 15 - ER Modelling Flashcards
1
Q
Design Considerations - ER
A
- Redundancy: A poor design can lead to repeated information, resulting in data inconsistency across various copies of information.
- Incompleteness: A flawed design may make it difficult or impossible to model certain aspects of the enterprise accurately.
2
Q
Design Approaches - ER
A
-
Entity-Relationship (ER) Model:
- Models an enterprise as a collection of entities and relationships.
- Entity: A distinguishable “thing” or “object” in the enterprise, described by a set of attributes.
- Relationship: An association among several entities, represented using ER diagrams.
-
Normalization Theory (Covered in Chapter 7):
- Formalizes what constitutes bad design and provides methods to test for it.
3
Q
Entity Sets
A
- Entity: An object that exists and is distinguishable from other objects (e.g., person, company, event).
- Entity Set: A collection of entities of the same type sharing the same properties (e.g., set of all persons).
-
Attributes: Descriptive properties of an entity (e.g.,
instructor = (ID, name, salary)
). - Primary Key: A subset of attributes that uniquely identifies each member of the entity set.
4
Q
Representing Entity Sets in ER Diagrams
A
- Rectangles represent entity sets.
- Attributes are listed inside the entity rectangle.
- Primary Key attributes are underlined.
5
Q
Relationship Sets
A
-
Relationship: An association among several entities.
- Example: The relationship between a student and an instructor acting as an advisor.
-
Relationship Set: A mathematical relation among entities from different entity sets.
- Example:
(44553, 22222)
in theadvisor
relationship set.
- Example:
6
Q
Relations Sets - ER Diagram
A
- Diamonds represent relationship sets.
- Lines between related entities depict relationships.
7
Q
Attributes in Relationship Sets
A
-
Attributes can be associated with relationship sets.
- Example: The
advisor
relationship set may have an attributedate
to track when the student started with the advisor.
- Example: The
8
Q
Roles in Relationship Sets
A
- Entity sets in a relationship can have specific roles.
- Example: In a course prerequisite relationship,
course_id
andprereq_id
are roles.
- Example: In a course prerequisite relationship,
9
Q
Degree of Relationship Sets
A
- Binary Relationships: Involve two entity sets (degree two) and are the most common.
-
Ternary Relationships: Involve three entity sets (rare).
- Example: A relationship between
instructor
,student
, andproject
in a research project setting.
- Example: A relationship between
10
Q
Complex Attributes
A
-
Attribute Types:
- Simple vs. Composite Attributes: Composite attributes can be divided into smaller sub-parts.
-
Single-valued vs. Multivalued Attributes: Example of multivalued attribute—
phone_numbers
. -
Derived Attributes: Attributes that can be computed from other attributes (e.g.,
age
fromdate_of_birth
).
- Domain: The set of permitted values for each attribute.
11
Q
Composite Attributes
A
- Composite Attributes: Attributes that can be divided into subparts, each of which can be an attribute on its own.
- Example: An address can be divided into street number, street name, and apartment number.
12
Q
Complex Attributes - ER Diagram
A
Complex attributes like names (first, middle, last) and addresses (street, city, state) can be represented in an ER diagram by showing their subcomponents.
13
Q
Mapping Cardinality Constraints
A
-
Cardinality Constraints: Express how many entities in one set can be associated with entities in another set.
- One-to-One: Each entity in one set is associated with at most one entity in the other set.
- One-to-Many: Each entity in one set can be associated with many entities in the other set.
- Many-to-One: Many entities in one set can be associated with one entity in the other set.
- Many-to-Many: Entities in both sets can be associated with many entities in the other set.
14
Q
Canrdinality Constraints - ER Diagram
A
- One-to-One: Represented by a directed line in an ER diagram.
- One-to-Many: Represented by an undirected line in an ER diagram.
-
Many-to-one: in a many-to-one relationship between aninstructorand astudent:
- an instructor is associated with at most one student viaadvisor,
- and a student is associated with several (including 0) instructors via advisor
15
Q
Total and Partial Participation
A
- Total Participation: Every entity in the entity set must participate in at least one relationship in the relationship set (indicated by a double line).
- Partial Participation: Some entities in the entity set may not participate in any relationship in the relationship set.