Logical Data Model & Normalisation Flashcards

Week 2.2 (27 cards)

1
Q

what does translating the conceptual model into a logic model involve

A
  • translating ER diagrams
  • normalising these relations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the 7 relationships that can be derived

A
  1. strong entity
  2. weak entity
  3. one-to-many (1:*)
  4. one-to-one (1:1)
  5. one-to-one recursive (1:1 recursive)
  6. many-to-many (:)
  7. complex relationships
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a strong entity & how to derive it

A
  • create a relation that includes all the simple attributes of that entity
  • primary key of the relation is the primary key of the entity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a weak entity & how do you derive it

A
  • create a relation that includes all simple attributes
  • primary key is partially or fully derived from each owner entity after all relationships with the owner entities have been mapped
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a 1:* relationship

A

the entity on the ‘one side’ is designated as the parent entity and the entity on the ‘many side’ is designated as the child entity

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

how to represent a 1:* relationship

A

a copy of the primary key attribute(s) of the parent entity is placed in the relation for the child as a foreign key

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

why is a 1:1 relationship complex

A

cardinality cannot be used to identify the parent and child entities in a relationship

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

what are used to define how 1:1 cases are implemented

A

participation constraints

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

what are the 3 participation constraints of 1:1 and 1:1 recursive relationships

A
  1. mandatory participation on both sides
  2. mandatory participation on one side
  3. optional participation on both sides
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how are mandatory participation on both sides represented in a 1:1 relationship

A

combine entities into one relation and choose one of the primary keys of the original entities to be primary key and the other (if exists) as an alternate key

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

how is mandatory participation on one side represented in a 1:1 relationship

A

entity with optional participation is designated as parent entity, and entity with mandatory participation is designated as child entity. a copy of primary key of the parent entity is placed in the relation for the child entity as the foreign key.

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

how is optional participation on both sides represented in a 1:1 relationship

A

arbitrary designation of the parent and child entities unless we can find out more about the relationship that can help a decision to be made one way or another

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

how is mandatory participation on both sides represented in a 1:1 recursive relationship

A

represent the recursive relationship as a single relation with two copies of the primary key. one copy represents a foreign key and should be renamed to indicate the relationship it represents

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

how is mandatory participation on one side represented in a 1:1 recursive relationship

A

either a single relation with two copies of the primary key (like mobs) or create a new relation to represent the relationship. this relation would have only two attributes which are both copies of the primary key with one renamed to act as a foreign key.

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

how is optional participation on both sides represented in a 1:1 recursive relationship

A

create a single relation with two copies of the primary (like mobs)

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

how is a : relationship represented

A
  • create a relation for the relationship with all attributes of the relationship, with a copy of the primary key of the participating entities as foreign keys
    these foreign keys will also form the primary key of the new relation
17
Q

how are complex relationships represented

A
  • create a relation to represent the relationship. Copy the primary key of the participating entities as foreign keys
  • any foreign keys that represent a ‘many’ relationship generally will also form the primary key of this new relation
18
Q

what 3 things does normalisation produce

A
  1. minimal number of attributes necessary to support the data requirements
  2. attributes with a close logical relationship placed in the same relation
  3. minimal redundancy, with each attribute represented only once, except those forms all or part of foreign keys
19
Q

what are the 3 normal forms

20
Q

what is 1NF

A

a relation is in 1NF when intersection of each row and column contains one value only
- atomicity

21
Q

what is a relating group

A

a column containing multiple values for a row

22
Q

what 2 ways do we deal with repeating groups

A
  • place each value in a new row and fill in the other columns with the nonrepeating data
    OR
  • place the repeating data in a separate relation together with a copy of the key attribute
23
Q

what is 2NF

A
  • if the primary key of a relation consists of a single attribute, it is automatically in at least 2NF
  • a relation in 2NF is a relation that is in 1NF and every non-primary key attribute is fully functionally dependent on the primary key
  • removal of partial dependencies - when a non-primary key attribute is dependent on only part of a primary key
24
Q

how do we remove partial dependencies

A

if they exist - remove the partially dependent attributes from the relation and place them in a new relation with a copy of the primary key attribute they are dependent on. primary key attribute is called their determinant

25
what is 3NF
a relation is in 3NF if it is in 1NF and 2NF, and no non-primary key attribute is transitively dependent on the primary key
26
how do we deal with transitive dependency
if there is a transitive dependency, remove the transitively dependent attributes and place them in a new relation together with a copy of the determinant
27
what is transitive dependency
occurs when a non-key attribute depends on another non-key attribute, which in turn depends on the primary key