DBMS GRaded Assignment NO3
DBMS GRaded Assignment NO3
Q#1 What is Functional dependency, Partial dependency, fully functional dependency and
Transitive dependency in database?
1. Functional dependencies
If the information stored in a table can uniquely determine another information in the same table, then it is
called Functional Dependency. Consider it as an association between two attributes of the same relation. If K
functionally determines L , then
K -> L
Example:
<student>
In the above table, Std_name is functionally dependent on std_ID because std_name can take only one
value for the given value of std_iD
The term full functional dependency is used to indicate the minimum set of attributes in of a functional
dependency. In other words, the set of attributes X will be fully functional dependent on the set of attributes
Y if the following conditions are satisfied:
<project budget>
<worker project>
Worker_iD projectiD Hrs. spent
W1312 1162 50
W1902 1612 29
The above relations states worker_ID, ProjectID, Project budget -> Hrs. spent However, it is not fully functional
dependent. Whereas the subset {worker_ID, ProjectID} can easily determine the {Hrs} spent on the project by the
worker. This summarizes and gives our fully functional dependency
3. Partial dependency
Partial dependency means that a nonprime attribute is functionally dependent on part of a candidate
key. (A nonprime attribute is an attribute that's not part of any candidate key).
In the above table, we have partial dependency. The prime key attributes are Std_ID and Course_code. As
stated, the non-prime attributes i.e. Std_Name and Course_Name should be functionally dependent on part
of a candidate key, to be Partial Dependent. The Std_Name can be determined by Std_ID that makes the
relation Partial Dependent. The course_Name can be determined by course_code, which that the relation
Partial Dependent.
4. Transitive dependency
When an indirect relationship causes functional dependency. it is called Transitive Dependency. A transitive
is a type of functional dependency which happens when it is indirectly formed by two functional
dependencies. i.e. If K-> L and L-> J is true, then K-> J is a transitive dependency.
Here in the above table we have transitive dependency. the Book attribute determines
the Author attribute. If you know the book name, you can learn the author's name.
However, Author does not determine Book, because an author can write multiple books. Likewise,
the Author attribute determines the Author_Nationality, If we know the book name, we can
determine the nationality via the Author column.
Normalization:
Normalization is a database design technique that reduces data redundancy and eliminates
undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules
divides larger tables into smaller tables and links them using relationships. The purpose of
Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored logically
It is a process of organizing the data in database
Types
Here are the most commonly used normal forms:
The above table is not in the 1NF because according to the definition of 1NF, A relation is in first normal
form iff every attribute in every tuple contains an atomic value but in the above table you can see that in
STUD_PHONE attribute in first tuple there are two values and in the last tuple there is no value so that’s
why this table is not in the first normal form(1NF)
Now we are going to decompose the above table into 1NF:
Q#3 What is physical database design? Also explain different components of PDD?
Definition:
Physical database design is the last stage of database design.
The objective of physical database design is to implement the database as asset of stored records, files,
indexes and other data structures.
These data structures provide performance and also ensure data integrity, security, recoverability
Components of physical database:
There are five components of physical database design
Disadvantages:
Maintaining multiple copies of data is associated with increased storage costs. The storage space required
is in multiples of the storage required for a centralized system.
Each time a data item is updated, the update needs to be reflected in all the copies of the data at the
different sites. This requires complex synchronization techniques and protocols
d) Data distribution strategies hybrid:
In this strategy database is divided into critical and non-critical fragments
The non-critical fragments are stored at only one site and critical fragments are stored at multiple sites
3) File organization:
It is a technique used to physical arrange the records of a file on a secondary storage device.
Important points:
Minimizing need for reorganization
High throughput for processing transactions
Fast access for retrieval of data
Accommodating growth
Protection from failure of lost data
Efficient use of storage of space
4) Indexes:
it is use to locate a record file in a file more quickly.
it is use to speed up the sorting and searching procedure.
some indexes are created automatically when relationships are created in related tables.
the index may be created on primary key, secondary key, foreign key etc.
the indexes are stored in index file.
DBMS uses these files to improve their performance.
5) Integrity constraints:
Integrity means the correctness and completeness of data to make database consistence.
Integrity is usually expressed in terms of certain constraints which are the consistency rules.
Data base are not permitted to violate these rules.
It also concerned with the quality of data.
These are rules that are designed to keep the data consistent and correct.