L8 Normal Forms Flashcards
What is Data redundancy?
Data redundancy is a condition created within a database or data storage technology in which the same piece of data is held in two separate places.
This can mean two different fields within a single database, or two different spots in multiple software environments or platforms.
What is lossy decomposition?
The decompositio of relation R into R1 and R2 is lossy when the join of R1 and R2 does not yield the same relation as in R.
What is good database design based on?
on using certain normal
forms for relation schemas
What is Transitive dependency?
Transitive dependency occurs when
a non-key attribute is determining another non-key attribute
What is the First Normal Form (1NF)?
For a table to be in the First Normal Form, it should follow the following rules:
- It should only have single(atomic) valued attributes/columns.
- Values stored in a column should be of the same domain
- All the columns in a table should have unique names.
Name two interconnected problems caused by bad database design.
- Redundancy problems
- Update anomalies
What is a Trivial Functional Dependency?
If a functional dependency (FD) X → Y holds, where Y is a subset of X, then it is called a trivial FD. Trivial FDs always hold.
What are the three types of update anomalies?
- Insertion Anomalies
- Deletion Anomalies
- Modification Anomalies
What is Dependency Preservation?
A decomposition is dependency preserving if the FDs
which hold on the original relation schema can be tested
on the decomposed schemas, without using joins.
“Putting it simply dependency is preserved when we find both sides of the FD in the attributes of one sub-schema”
We cannot always find a BCNF decomposition that is
dependency preserving.
To test that no FDs are violated, we may need to join
relations (expensive).
We can always find a 3NF dependency-preserving
decomposition.
What is an insertion anomaly?
An insertion anomaly is the inability to add data to the database due to absence of other data.
For example, assume Student_Group is defined so that null values are not allowed. If a new employee is hired but not immediately assigned to a Student_Group then this employee could not be entered into the database. This results in database inconsistencies due to omission.
What is a Lossless join?
the ability to ensure that any instance of the original relation can be identified from corresponding instances in the smaller relations
What is the Boyce–Codd normal form (BCNF)?
A relational schema R is in Boyce–Codd normal form if and only if for every one of its dependencies X → Y, at least one of the following conditions hold:
1) X → Y is a trivial functional dependency (Y ⊆ X)
2) X is a superkey for schema R
It is a slightly stronger version of the third normal form (3NF)
BCNF acts differently from 3NF only when there are multiple overlapping candidate keys.
What is the Third normal form (3NF)?
- The relation R (table) is in second normal form (2NF)
- Every non-prime attribute of R is non-transitively dependent on every key of R.
What is Dependency Preservation?
A decomposition is dependency preserving if the FDs
which hold on the original relation schema can be tested
on the decomposed schemas, without using joins.
We cannot always find a BCNF decomposition that is
dependency preserving.
We can always find a 3NF dependency-preserving
decomposition.
Describe the BCNF Decomposition Algorithm.
Split R into two relation schemas:
1. R1 , containing all the attributes in the
violating FD
2. R2 containing all attributes in R
except those on the RHS of the violating FD