Entity Relationship Model Flashcards

1
Q

What is the ER model? Why do we need one?

A

An object data model.
We need one to provide a unified way in which all users can interpret the database.

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

What are the 4 components of the ER model?

A

Entities, Relationships, Attributes, Constraints.

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

What are the 2 categories of entities?

A

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.

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

What is a relationship? What are the different types?

A

A relationship is a meaningful association between entity types.
Relationships can be recursive, binary, ternary etc.

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

What is the degree of a relationship?

A

The number of entities that a relationship associates.

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

What are attributes? What are the different types of attributes?

A

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.

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

What is the domain of an attribute?

A

All the possible values that the attribute can hold.

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

Define the main constraint in ER models?

A

Multiplicity. This represents the number of entities that a certain entity can relate to.

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

What is the purpose of keys in the ER model?

A

To enable unique identification of any entity instance in a table.

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

What are the 4 types of key?

A

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.

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

Why is it sometimes necessary to give a relationship attributes?

A

To avoid conflicts between primary keys of 2 entities.

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

Do relationships have keys?

A

No.

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

Define the 2 types of entites?

A

Strong entity - Can exist independently.
Weak entity - Existence relies on another entity.

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

Define multiplicity

A

A structural constraint that represents the number of entity instances that any given entity instance can relate to.

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

What are the 3 types of multiplicity?

A

one to one, one to many, many to many.

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

How can we implement multiplicity on a complex relationship?

A

Define the multiplicity of any of the chosen entities when the other n-1 entities are fixed.

17
Q

Define cardinality of an entity…

A

The maximum value of the multiplicity constraint of an entity. Aka, the maximum number of associations an entity instance can make to another entity instance.

18
Q

Define participation of an entity…

A

Defined whether or not an entity must participate in a relationship. Aka, the minimum value in a multiplicity constraint.