Topic 6: Relations Flashcards

1
Q

How do you represent Regular Entities

A

For each Entity type E in the ERD model, create a relation R such that it includes all attributes of the Entity type E
- name is in capital letters
- 2 dimensional table where each column is an attribute of the entity
- order doesn’t matter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you represent Binary 1:N relationships

A
  • Add the primary key of the entity of the one-side of the relationship as the foreign key in the relation that is on the many-side of the relationship
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you represent Binary 1:1 Relationships if none of the entities participate in any other relationship

A

If the relationship is total, which means that one instance of an entity ensures the existence of another instance of another entity and that the entitities do not participate in any other relationships then one can represent it to one relation.

This means that the attributes of one entity will be moved to the other entity and one common primary key is established

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you represent Binary 1:1 Relationships if atleast one of the entities participates in other relationships

A
  • Add the primary key of an entity A as a foreign key to entity B
  • Add the primary key of an entity of an entity B as a foreign key to entity B
  • Both representations (Add PK of entity A as an FK of B and Add PK of entity B as an FK of A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to represent Binary Relationships if relationships has an attribute?

A
  • The attributes of the relationship will be placed on the entity where the foreign key is placed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to represent Binary M:N Relationships

A
  • Create a separate relation for the relationship and add the primary keys of Entity A and Entity B and the attributes of the relationship (if any) to the relation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to represent Unary 1:N relationships

A

In the relation, add another a attribute that is a rename of the Primary key of the entity and add it as a foreign key with a reference to the relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you represent Unary M:N Relationships

A
  • Create another relation to represent the relationship, add the primary key of all partipating relationships (include the rename)
  • Primary key will be the set of all of its foreign keys
How well did you know this?
1
Not at all
2
3
4
5
Perfectly