Week 3 Flashcards
What is Multiplicity?
Number of possible occurences of an entity type that may relate to a single occurrence of an associated entity type through a particular relationship
What are examples of Binary Relationships?
One-to-One (1:1)
One-to-Many (1:*)
Many-to-Many (:)
What does 0..1 mean?
0 or 1 entity occurence
What does 1..1 (or just 1) mean?
Exactly 1 entity occurence
What does 0..* (or just *) mean?
Zero or many entity occurences
What does 1..* mean?
One or many entity occurences
What does 3..7 mean?
Minimum of 3 up to maximumm of 7 entity occurences
What does 1, 5, 10-12 mean?
1 or 5 or 10 to 12 entity occurences
What is Cardinality?
Maximum values for the multiplicitiy ranges on either side of the relationship
One-to-One (1:1)
One-to-Many (1:*)
Many-to-Many (:)
What is Participation?
Minimum values for the multiplicity ranges on either side of the relationship
Optional participationn (if 0)
Mandatory participation (if 1 or more)
eg. participation of 1..* is mandatory as 1 is the minimum
What is a Fan Trap?
May exist where two or more 1:* relationships fan out from the same entity
A fan trap in databases happens when one item is connected to multiple related items, making it confusing to aggregate data correctly
Fixed by changing structure of the database
What is a Chasm Trap?
A chasm trap in databases occurs when there’s a gap in relationships between entities, making it hard to connect data correctly
Fixed by changing the structure of the database
What is the difference between a Fan Trap and a Chasm Trap?
Fan Traps: Path between certain entity occurences is ambiguous
Chasm Traps: Pathway does not exist between certain entity occurences - pathway connection missing
Steps for Conceptual Database Design
- Identify entity types
- Identify relationship types
- Identify and associate attributes with entity and relationship types
- Determine primary keys for entity types
- Identify Multiplicity constraints
- Consider use of enhanced modeling (optional)
- Check model for redundancy traps
- Validate conceptual model against user transactions
- Review conceptual data model with user
What is an example of a One-To-One (1:1) Relationship?
Staff ID ————–> name
1..1 manages 0..1
Exactly one professor is needed to manage a discipline
Professor could manage at most 1 discipline. Not all professors do management therefore 0..1
What is an example of a One-To-Many (1:*) Relationship?
staffNo ————–> studentNo
1 Tutors 0..*
One staff member tutors 0 to many students
What is a Many-To-Many (:) Relationship example?
newspaperName ———> PropertyForRent
Advertises
0..* 1..*
Each property is advertised in zero or more newspapers
Each newspaper may advertise one or more properties for rent
What is Specialisation?
Process of maximising the differences between members of an entity by identififying their distinguishing characteristics
What is Generalisation?
The process of minimizing differences between entities by identifying their common characteristics
Grouping entities with common attributes into one super-type
Subtypes of a super-type don’t need to have their primary key displayed in their attributes as its displayed in the super-type
What are the 2 types of Participation Constraint?
Optional
Definition: An entity may participate in a relationship, but it’s not required
Example: An employee may have a car but doesn’t have to
Mandatory
Definition: An entity must participate in a relationship
Example: A student must have an enrollment in a course
What are the 2 types of Disjoint Constraint?
And - If there is overlaps between roles
Or - if there is not overlaps between roles
What is an example of a Specialisation/Generalisation constraint?
{Optional, And}
First part is the Participation Constraint
Second part is the Disjoint Constraint
What is Aggregation?
An abstraction through which relationships are treated as higher-level entities