Exam 2 Flashcards
Functional Dependency
A functional dependency is a relationship between attributes. A functional dependency is
desirable when a key determines the rest of the row.
However, if a “key” determines only some of the attributes, then it’s the key of some other
object and those attributes belong in their own table. If they stay in the same table then it
leads to redundancy and modification anomalies.
First Normal Form
First Normal Form means that attributes in a table must be:
Atomic, meaning that a single attribute cannot contain a list, array, or other structure that
must be searched or processed to determine its contents.
Non-repeating, meaning that an attribute cannot be duplicated multiple times in a row to
produce a list within a single row.
Deletion Anomaly
A deletion anomaly is the side effect of placing data about more than one object in the same
table. When a row is deleted, data about both objects is eliminated.
Example: Deleting a part from a parts list also deletes the vendor from the database.
Second Normal Form
Second Normal Form means all the attributes in a row are functionally dependent on the
whole key, not just part of the key. This only affects tables with composite keys.
Put another way, there are no partial-key dependencies.
Why do normalization problems occur?
Normalization problems occur because a table represents two objects.
Dividing the table
into two, one for each object (“decomposition”), eliminates redundancy, solves modification
anomalies, and brings the table to a higher normal form.
What are second and third normal forms concerned with?
Second and Third Normal Forms are both concerned with an attribute that’s a non-key
determinant. In 2NF, the non-key determinant is a component of the table’s composite key,
and in 3NF the non-key determinant is outside of the table’s key.
Describe 1NF, 2NF and 3NF
1NF eliminates non-atomic and repeating attributes in a table. 2NF and 3NF describe a
determinant that doesn’t belong to the key.
Describe BCNF
BCNF is the general statement that covers all non-key determinants. That means that all
attributes describe the key.
What are the three characteristics of unnormalized tables?
An unnormalized table is undesirable because it has these negative characteristics:
- Unnormalized tables have data redundancies.
- Data redundancies cause modification anomalies.
- Modification anomalies make the data unreliable and hard to maintain.
the other answers (more tables, more joins, and slower performance) are drawbacks of
normalized tables. The benefits of normalization usually outweigh the drawbacks.
What is Data Redundancy in a table?
Data Redundancy in a table is the same fact stated more than once.
- It’s caused by two objects sharing the same table.
- It’s undesirable because it leads to modification anomalies.
What is the most common cause of unnormalized tables?
The cause of a table’s normalization problems is almost always that the table models more
than one real-world object. This causes the table to have data redundancy that results in
modification anomalies.
What is Fourth Normal Form?
Fourth Normal Form says that a table may not contain two or more independent multivalued dependencies. A key point is independent. Two multi-valued dependencies that are
interrelated are not independent.
For example, a cable TV company may offer a set of channels (one multi-valued
dependency) and it may cover a set of regions (another multi-valued dependency). If it
offers the same set of channels in each of its regions, the two dependencies are
independent of each other and should not appear together in the same table.
However, if the cable TV company offers a different set of channels within each of its
different regions, then we have to know which region we’re considering before we know
which set of channels is offered. These two dependencies are not independent, and must
appear together in the same table to establish their relationship.
What problems do 2NF, 3NF and BCNF address?
2NF, 3NF, and BCNF deal with problems involving functional (non-key) dependencies in
which a determinant points to a specific value.
What problems do 4NF and 5NF address?
4NF and 5NF are about multi-valued
dependencies in which a determinant points to a set of values.
How common are 5NF normalization issues?
Fifth Normal Form problems are rare, depend on business rules, and are seldom
encountered by database practitioners.
What are 2NF, 3NF and BCNF concerned with?
2NF, 3NF, and BCNF are all concerned with non-key functional dependencies. 2NF and
3NF describe specific configurations of non-key dependencies, while BCNF is a catch-all
that addresses any other kind of non-key dependency. Some textbooks don’t distinguish
among these three normal forms and lump them all under BCNF.
What problems are caused by Redundancy?
Redundancy:
- Causes modification anomalies.
- Is a maintenance headache to keep multiple copies of data synchronized.
- Requires extra storage.
Redundancy is a result of un-normalized tables, and the elimination of redundancy is the
goal of normalization.
What conditions must a table meet to be considered normalized?
If all of these conditions are met, then a table is very well (though perhaps not perfectly)
normalized:
- 1NF – All attributes are atomic
- 2NF, 3NF, BCNF – The only determinants in any functional dependency are keys
- 4NF – There are not two or more independent multi-valued dependencies.
What are some characteristics of Redundancy?
Repetition of a fact (including repetition of a pairing of values) is called Redundancy.
- It causes modification anomalies
- It’s caused by a non-key functional dependency.
- Which in turn occurs when a single table models more than a single object.
Describe DKNF.
DKNF states that every constraint on a table is a consequence of its Domains and Keys. If
a table has a constraint that “date-of-birth” and “age” agree with each other, this constraint
cannot be enforced by either a key of the table, or the domains of the attributes.
If a table has a pair of columns that provide the same information but in different terms
(such as “date-of-birth” and “age”), this is a redundancy and the table isn’t in Domain/Key
Normal Form.
Describe decomposition measures.
Correcting a normalization problem almost always involves decomposing a table into two
new tables.
- Repeating Attributes (1NF) – use the multivalued attribute patern
- Non-Key (Functional) Dependencies (2NF, 3NF, BCNF) – separate table for each
dependency - Two Independent Multi-valued Dependencies (4NF) – separate table for each
dependency
Sometimes the problem is caused by an attribute being in the wrong table, and can be
corrected by simply moving the attribute into its correct table.
What is a Multi-Valued Dependency?
A Multi-valued dependency means a determinant (“key”) points to a set of values rather
than to just a single value.
A multi-valued dependency occurs in the intersection table forming a many-to-many
relationship.
What does the acronym ACID stand for?
ACID is an acronym for Atomic, Consistent, Isolated, Durable; these are the properties that
well behaved transactions must possess to be useful.
- Atomic means that a transaction will execute in its entirety or not at all.
- Consistent means that if the database was in a consistent state when a transaction
started, it will still be in a consistent state when it ends. - Isolated means that transactions will not interfere with each other.
- Durable means that a transaction will not produce results that will be inadvertently lost.