DBMS Unit 3
DBMS Unit 3
Relational Model: Basic concepts, Attributes and Domains, CODD's Rules, Functional Dependencies:
Basic concepts, closure of set of functional dependencies, closure of attribute set, canonical cover,
Decomposition: lossless join decomposition and dependency preservation, The Process of
normalization, 1NF, 2NF,3NF, BCNF,4NF, 5NF.
Relational Model
Attribute: It's a column name in a particular relation and each attribute must have a domain.
Complete non-trivial
If A intersection B is NULL, then A → B is called as complete non-trivial.
Stud_ID → Stud_Name,
Stud_Name → Stud_DOB
closure of set of functional dependencies
When a set of functional dependencies of all possible functional dependencies from given set of functional
dependencies then it is called as closure of set of functional dependencies.
If R is the given relation and F is used to donate the set of functional dependencies then closure of set of
functional dependencies impied by F is demoted by F+.
Let's consider the set F of functional dependencies and R is relation mentioned below :
R={X,Y,Z,A,B}
FD
X->YZ,ZA->B,Y->A,B->X
Then F+ is as follow
X->YZ then X->Y,X->Z
X->Y, Y->A then X->A
ZA->B,B->X then ZA->X
Closure of an Attribute
Closure of an Attribute can be defined as a set of attributes that can be functionally determined from Closure of an
Attribute.
Closure of a set F of FDs is the set F+ of all FDs that can be collect from F
canonical cover
Let us consider scenario of database updation, In case of database updation its important to check whether the available
functional dependencies are break during the process of updation and rollback need to take place if functional dependencies are
break during the process of updation
A canonical cover is a set of functional dependencies is a simplified set of functional dependencies that has a similar closure as
the original set functional dependencies.
Decomposition: lossless join decomposition
and dependency preservation
Decomposition of relation is necessary if the relational model is not in suitable normal form and also it is used
to eliminate various problems like anomalies and inconsistencies.
Types of Decomposition :
-Lossless Decomposition : The decomposition is called lossless if the information is not lost from the
decomposed relation
- Dependency Preserving : In this type of decomposition, at least one decomposed table must satisfy all
dependency.
CODD's Rules
1. Information Rule :
As database is used to store the information, the information in database must be stored in table format.
- In th process of normalization, larger table divides into the smaller table and can be links them using relationship.
- In normalization the normal form is used to reduce redundancy from the database table.
Normalization
In 1NF each attribute must contain only a single value from its already defined domain.
Student table:
3 PQR 123
456
Normalization
The decomposition of the Student table into 1NF has been shown below:
- In the given table Stud_id and Faculty_id are key attributes whereas Stud_Name and
Faculty_Name are Non key attributes
-To convert the given table into 2NF, we decompose it into two tables:
- In above example Stud_id is primary key attribute, Stud_name can be identified by Stud_id and
City can be identified by pincode as well as Stud_id. In given relation transitive dependency is
exists Stud_id->pincode->city
-To convert the given table into 3NF, we decompose it into two tables Student and Pincode :
In the , Stud_id is the super-key in the given relation of Student and pincode is the super-key in the relation Pincode. So,
and
pincode → City
https://www.geeksforgeeks.org
www.c-sharpcorner.co
m
https://dotnettutorials.net