Unit-03 DBMS Notes
Unit-03 DBMS Notes
Example:-
2. Entity integrity constraints
Example:-
3. Referential Integrity Constraints
X → Y
The left side of FD is known as a determinant, the right
side of the production is known as a dependent.
For example:
Assume we have an employee table with attributes:
Emp_Id, Emp_Name, Emp_Address.
Functional Dependency…
Example:
X = {a, b, c, d, e}
Y = {a, b, c}
2. Augmentation Rule (IR2)
The augmentation is also called as a partial dependency. In
augmentation, if X determines Y, then XZ determines YZ for
any Z.
If X → Y then XZ → YZ
Example:
For R(ABCD), if A → B then AC → BC
3. Transitive Rule (IR3)
In the transitive rule, if X determines Y and Y determine Z,
then X must also determine Z.
If X → Y and Y → Z then X → Z
4. Union Rule (IR4)
Union rule says, if X determines Y and X determines Z, then
X must also determine Y and Z.
If X → Y and X → Z then X → YZ
Proof:
1. X → Y (given)
2. X → Z (given)
3. X → XY (using IR2 on 1 by augmentation with X. Where
XX = X)
4. XY → YZ (using IR2 on 2 by augmentation with Y)
5. X → YZ (using IR3 on 3 and 4)
5. Decomposition Rule (IR5)
Decomposition rule is also known as project rule. It is the
reverse of union rule.
This Rule says, if X determines Y and Z, then X determines Y
and X determines Z separately.
If X → YZ then X → Y and X → Z
Proof:
1. X → YZ (given)
2. YZ → Y (using IR1 Rule)
3. X → Y (using IR3 on 1 and 2)
6. Pseudo transitive Rule (IR 6)
In Pseudo transitive Rule, if X determines Y and YZ
determines W, then XZ determines W.
If X → Y and YZ → W then XZ → W
Proof:
1. X → Y (given)
2. WY → Z (given)
3. WX → WY (using IR2 on 1 by augmenting with W)
4. WX → Z (using IR3 on 3 and 2)
Normalization
❖Normalization is the process of organizing the data in the
database.
❖Normalization is used to minimize the redundancy from a
relation or set of relations.
❖It is also used to eliminate the undesirable characteristics
like Insertion, Update and Deletion Anomalies.
❖Normalization divides the larger table into the smaller
table and links them using relationship.
❖The normal form is used to reduce redundancy from the
database table.
Normalization
➢ This is the process which allows you to winnow out
redundant data within your database.
➢ This involves restructuring the tables to successively
meeting higher forms of Normalization.
➢ A properly normalized database should have the
following characteristics
1. Scalar values in each fields
2. Absence of redundancy.
3. Minimal use of null values.
4. Minimal loss of information.
Levels of Normalization
Levels of normalization based on the amount of
redundancy in the database.
Various levels of normalization are:
1. First Normal Form (1NF)
2. Second Normal Form (2NF)
Redundancy
Number of Tables
3. Third Normal Form (3NF)
Complexity
4. Boyce-Codd Normal Form (BCNF)
5. Fourth Normal Form (4NF)
6. Fifth Normal Form (5NF)
Most databases should be 3NF or BCNF in order to avoid the database anomalies.
Levels of Normalization
1NF
2NF
3NF
4NF
5NF
0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333
Example 1
Example 3
6 Joyce 666-666-6666
7 Roman 444-444-4444
Second Normal Form (2NF)
For a table to be in 2NF, there are two requirements
➢ The database is in first normal form
➢ All non-key attributes in the table must be functionally
dependent on the entire primary key
➢ The table should not contain any partial dependency.
Note: Remember that we are dealing with non-key attributes