Lecture IV: Normalization Flashcards

1
Q

How is the act of normalization often done?

A

The act of normalization is often done through a series of tests on one ore more tables. This is to determine if they comply or violate the rules for a given normal form.

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

What are the two ways to perform normalization?

A

There are two ways to perform normalization: the first is a bottom-up database design methodology while the second is a top-down development process.

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

How does the bottom-up database design metodology work?

A

(Man skippar conceptual design(erd osv) och går direkt till logical design)

In the bottom-up approach, we analyze the relationships between attributes to create tables that represent entities and their relationships.

  • In other words, we design the database at the table level. There is no ER-diagram design phase.

Normalization is then used to “clean up” poorly structured tables.

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

How does the top-down database design metodology work?

A

In top-down, ER modeling is used to create a model that represents, entities, relationships and attributes..

  • The ER model is then translated into tables. When this is done, we normalize these tables to see if the tables are designed correctly.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is one thing normalization reduce the risk of?

A

Normalization reduces the risk of anomalies

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

What is the aim of normalization?

A

The aim of normalization is to free the database from the aforementioned anomalies.

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

What does normalization ensure?

A

Normalization ensures that when a new value is introduced in a relationship, it has minimal effect on the database and therefore also minimal effect on the program that uses the database.

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

How does First Normal Form (1NF) work?

A

First Normal Form (1NF)

  • Atomic columns
  • A table in which the interesection of every column and record contains only one value.
  • It is the only normal form that is critical for creating relational database tables, but to avoid update anomalies it is recommended to proceed through to 3NF.
  • A column that contains more than one entry per record must be removed to create a new table where the duplicate valuesa re flattened to become new primary keys.
  • 1NF also require that the table has a primary key.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a foreign key?

A

A foreign key is a column or columns that are used to create a link between two tables.

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

What is the table that contains the foreign key called?

And what is the table that contains the condidate key called?

A

The table that contains the foreign key is called the referencing table and the table that contains the candidate key is called the referenced table.

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

Why is it generally requied that the foreign key be the same as a candidate key in any row in the referenced table?

A

Since the purpose of a foreign key is to identify a particular row in the referenced table, it is generally required that the foreign key be the same as a candidate key in any row in the referenced table.

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

How does Second Normal Form(2NF) work?

A

Second Normal Form (2NF) applies to tables with composite primary keys, I.e a primary key composed of two or more columns.

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

What does Functional Dependency describe?

A

Functional Dependency describes the relationship between columns in a table and indicates how columns relate to one another.

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

Consider a table with columns a and b, where column a determines column b. (which is written as a -> b).

What does that mean?

A

That means that fi we know the value for a, the value of “b” will always be the same for every record where “a” has this particular value.

However, even if we know the value of “b”, “a” can have several different values.

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

What are some consequences of Partial dependency?

A

That consequence of partial dependance is that it creates problems. More specifically redudant data. In our case in the columns name and position which can lead to update anomalies.

  • For example, to rename ‘Ellen Layman’, we need to update two rows in our table.
  • If we only update one row, the databse will be inconsistent.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the formal definition of Second Normal Form (2NF)?

A

The formal definition of 2NF is a table that is in 1NF, and every column, that is not a part of the primary key, is fully functionally dependant on the primary key.

17
Q

What is Full Functional Dependency?

A

If “a” and “b” are columns in a table, “b” is fully determined by “a” if “b” is not determined by a subset of “a”.

18
Q

What is Partial Dependency?

A

If “a” and “b” are columns in a table and -

If “b” is determined by a subset of “a”, this is referred to as a partial dependency.

19
Q

How do you know if a table is in Third Normal Form (3NF)?

A

A table is in 3NF if no column is transitively dependent on the primary key.

20
Q

What does Transitive dependency describe? and how does it look like?

A
  • Describes a relationship between columns “a”, “b” and “c”.
  • If “a” determines “b” (a->b) and “b” determines c (b->c), then “c” is transitively dependant on “a” via “b” (provided that “b” or “c” does not determine “a”)