Professional Documents
Culture Documents
MANAGEMENT
SYSTEM
(DBMS)
UNIT-III
SYLLABUS: UNIT-III
Internals of RDBMS:
Physical data structures, Query optimization: join
algorithm, statistics and cost base optimization.
Transaction processing, Concurrency control and
Recovery Management: transaction model properties, 2
state serializability, lock base protocols, two phase
locking.
FUNCTIONAL DEPENDENCY
The functional dependency is a relationship that exists
between two attributes.
It is denoted as X → Y where,
Y is functionally dependent on X
X is called Determinant set (attribute set on the left side of the
arrow) 3
Y is called the Dependent attribute.
TYPES OF FUNCTIONAL
DEPENDENCY
4
TRIVIAL FUNCTIONAL DEPENDENCY
A dependent is always a subset of the determinant.
E.g.
{ Employee_Id, Name } → { Name } is a Trivial functional dependency, since
the dependent Name is the subset of determinant { Employee_Id, Name }.
{ Employee_Id } → { Employee_Id }, { Name } → { Name } and { Age } →
{ Age } are also Trivial Dependencies.
5
NON-TRIVIAL DEPENDENCY
In Non-Trivial functional dependency, dependent is not a subset of the determinant.
E.g.
{Employee_Id} → {Name} is a non-trivial functional dependency because Name(dependent)
is not a subset of Employee_Id(determinant).
6
TRANSITIVE DEPENDENCY
Consider two functional dependencies,
A → B and B → C
According to the transitivity axiom, A → C must also exist.
7
MULTIVALUED DEPENDENCY
Attributes in the dependent set are not dependent on each
other.
X → { Y, Z }, if there exists is no functional
dependency between Y and Z, then it is called as Multivalued
functional dependency.
E.g.
{Employee_Id} → {Name, Age} is a Multivalued functional
dependency
The dependent attributes Name, Age are not functionally
dependent
8
PROPERTIES OF FUNCTIONAL
DEPENDENCY
Certain properties related to functional dependency are called RAT rules:
Reflexivity
If A is a set of attributes and B is a subset of A, then the functional dependency A→B holds true.
E.g. {Employee_Id, Name} → Name is valid
Augmentation
If a functional dependency A → B holds true, then appending any number of the attribute to both
sides of dependency doesn't affect the dependency. It remains true.
E.g.
If X → Y holds true then,
ZX → ZY also holds true.
Transitivity
If two functional dependencies X → Y and Y → Z hold true, then
X → Z also holds true
E.g. 9
if {Employee_Id} → {Name} holds true and {Name} → {Department} holds true, then
{Employee_Id} → {Department} also holds true.
INFERENCE RULES
Using Inference rules, we can derive additional functional dependency
from the initial set.
Reflexive Rule
Augmentation Rule
Transitive Rule
Inference Rules
Union Rule
Decomposition Rule
Proof:
X → YZ (given)
YZ → Y (using IR1 Rule)
X → Y (using IR3 on 1 and 2)
These anomalies can lead to data integrity issues and make it difficult to
retrieve and manipulate data efficiently.
There can be various reasons for anomalies to occur in the database such
as:
If there is a lot of redundant data present in our database.
If a table is constructed in a very poor manner then there is a chance of
database anomaly.
All the data is stored in a single table.
Insertion Anomaly
If there is a new row inserted in the table and it creates the
inconsistency in the table then it is called the insertion anomaly.
E.g.
if we create a new row of a worker, and if it is not allocated to any
department then we cannot insert it in the table 14
it will create an insertion anomaly.
ANOMALIES
Deletion Anomaly
If we delete some rows from the table and if any other information or
data which is required is also deleted from the database, this is called
the deletion anomaly in the database.
E.g.
if we want to delete the department number ECT669 then the details of
Rajesh will also be deleted since Rajesh's details are dependent on the row
of ECT669.
So, there will be deletion anomalies in the table.
15
16