Chapter 9 Flashcards

Relational Database Design by ER- and EERR-to-Relational Mapping. (Side note: it is better to study this set in order + ignore my side notes to myself if you would like [they are for my own understanding])

1
Q

T/F: Some of the goals during mapping include minimizing the null values.

A

true.

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

T/F: If the chosen key of regular entity type E is composite, the set of simple attributes that form it, will together form the primary key of R.

A

true.

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

The primary key of the relation R between weak entity type W and its owner entity type E, is the combination of the ________________ and ___________________, if any.

A

the primary key(s) of the owner(s), the partial key, of the weak entity type W.

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

When mapping the weak entity types:
For each weak entity type W in the ER schema with owner entity type E, create a relation R & include all simple attributes (or simple components of composite attributes) of ________ as attributes of R.
Also, include as foreign key attributes of R the primary key attribute(s) of the relation(s) that correspond to ___________.

A

weak entity type W, the owner entity type(s).

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

So in summary, when mapping weak entity types W with owner entities type E:-
Create a relation R where its….
attributes: include all simple attributes of W.
foreign key: will be the primary key attribute(S) of the relation(S) that correspond to the owner entity type(s).
primary key: a combination of the primary key(s) of the owner(s) and the partial key of the weak entity type, if any.

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

Name the 3 possible approaches for mapping a binary 1:1 relation type.

A

1- Foreign Key ( 2 relations) approach
2- Merged relation (1 relation) option
3- Cross-reference or relationship relation ( 3 relations) option

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

In the foreign key approach, it is better to choose an entity type with ___________ in R as the relation S including the foreign key that is the primary key of relation T.

A

total participation.

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

In the merged relation approach, when both relations have ____________, we merge the two entity types and the relationship into a _____________.

A

total participation, single relation.

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

In the cross-reference or relationship relation approach, we set up a __________ for the purpose of cross-referencing the _________ of the two realtions S and T representing the entity types.
The primary key of R will be _________________, and the other foreign key will be a _________ of R.

A

Third relation R , primary keys, one of the two foreign keys, unique key.

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

T/F: The merging relation approach may be appropriate when both participations are total, as this would indicate that the two tables will have the exact same number of tuples at all times.

A

true.

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

As for the mapping of binary 1:N relationship types, the relation S representing the participating entity type at ________________ will include the primary key of relation T (the other entity type participating in R) as a foreign key. And any simple attributes of the 1:N relation type will be included as attributes of ________.

An alternative approach is to use a cross-reference relation, where the primary key of R is the same as the primary key of ________.

A

the N-side of the relationship type, relation S, relation S.

(side note for me: in other more understandable words, the relation on the N-side is carrying the entire relationship on its back.)

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

As for the mapping of binary M:N relationship types, we will use a __________ relation to represent the relationship type.

A

relationship (cross-referencing) relation.

[side note for me: many-to-many relationships are the only ones to only have the cross-referencing relation as an option, whereas 1:1 & 1:N have the options to be represented in a foreignkey or cross-referencing relation (and 1:1 has an extra merged relation option.)]

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

As for the mapping of binary M:N relationship types, we will create a new relation S to represent R. It will include the primary keys of the relations that represent the participating entity types as the foreign key attributes of S.
And the ___________ will form the primary key of S.
It will also include any simple attributes of the _________________ as the attributes of S.

A

combination of the two foreign key attributes of S, M:N relationship type.

(Explanation of example in the figure: The primary key of the WORKS_ON relation is the
combination of the foreign key attributes {ESSN, PNO}.)

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

As for the mapping of multivalued attributes, for each multivalued attribute A, we will __________.

A

create a new relation R.

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

As for the mapping of multivalued attributes, for each multivalued attribute A we will create a new relation R which will include an attribute corresponding to A, plus the primary key attribute K-as a foreign key in R-of the relation that represents the entity type of relationship type that has A as an attribute.
The primary key of R is ____________________.

A

the combination of A and K.

(in other words, R = multivalued [attribute A + primary key K]=> together they form primary key K of R.)

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

T/F: As for the mapping of multivalued attributes, the primary key of R is the combination of A and K, and if the multivalued attribute is composite, we will only take one of the simple components as a primary key along with K.

A

F, we include its simple components as primary keys along with K

17
Q

As for mapping N-ary relationship types, we will use the (merged/relationship(cross-referencing) relation.)

A

relationship (cross-referencing)

18
Q

As for the mapping of N-ary relationship types, we will create a new relationship S to represent R. It will include the primary keys of the relations that represent the participating entity types as the foreign key attributes, and any simples attributes of the n-ary relationship type as attributes of S.
the primary key of S is usually _______________.

A

a combination of all the foreign keys.

19
Q

As for the mapping of N-ary relationship types, the primary key of S is usually a combination of all the foreign keys except if the cardinality constraints on any of the entity types E participating in R is ________, then the primary key of S should _________________________.

A

1, should not include the foreign key attribute that references the relation E′ corresponding to E.

20
Q

1:1 or 1:N relationship type in ER model corresponds to _________ in Relational models.

A

foreign key (or relationship relation)

21
Q

M:N relationship type in ER model corresponds to _____________ in Relational models.

A

Relationship relation and two foreign keys

22
Q

N-ary relationship type in ER model corresponds to _____________ in Relational models.

A

relationship relation and n foreign keys

23
Q

Composite attribute in ER model corresponds to _________________ in Relational model.

A

A set of simple component attributes.

24
Q

Multivalued attribute in ER model corresponds to ________________ in Relational model.

A

a relation and foreign key

25
Q

Value set in ER model corresponds to ________________ in Relational model.

A

a domain

26
Q

Key attribute in ER model corresponds to ________________ in Relational model.

A

a primary (or secondary) key