Lecture IV: Normalization Flashcards
How is the act of normalization often done?
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.
What are the two ways to perform normalization?
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 does the bottom-up database design metodology work?
(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 does the top-down database design metodology work?
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.
What is one thing normalization reduce the risk of?
Normalization reduces the risk of anomalies
What is the aim of normalization?
The aim of normalization is to free the database from the aforementioned anomalies.
What does normalization ensure?
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 does First Normal Form (1NF) work?
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.
what is a foreign key?
A foreign key is a column or columns that are used to create a link between two tables.
What is the table that contains the foreign key called?
And what is the table that contains the condidate key called?
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.
Why is it generally requied that the foreign key be the same as a candidate key in any row in the referenced table?
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 does Second Normal Form(2NF) work?
Second Normal Form (2NF) applies to tables with composite primary keys, I.e a primary key composed of two or more columns.
What does Functional Dependency describe?
Functional Dependency describes the relationship between columns in a table and indicates how columns relate to one another.
Consider a table with columns a and b, where column a determines column b. (which is written as a -> b).
What does that mean?
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.
What are some consequences of Partial dependency?
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.