The Wayback Machine - https://web.archive.org/web/20241009145137/https://www.geeksforgeeks.org/data-base-dependency-preserving-decomposition/
Open In App

Database Management System | Dependency Preserving Decomposition

Last Updated : 19 Jul, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Dependency Preservation: A Decomposition D = { R1, R2, R3…Rn } of R is dependency preserving wrt a set F of Functional dependency if

(F1 ? F2 ? … ? Fm)+ = F+.
Consider a relation R
R ---> F{...with some functional dependency(FD)....}

R is decomposed or divided into R1 with FD { f1 } and R2 with { f2 }, then
there can be three cases:

f1 U f2 = F -----> Decomposition is dependency preserving. 
f1 U f2 is a subset of F -----> Not Dependency preserving.
f1 U f2 is a super set of F -----> This case is not possible.

 Problem:

Let a relation R (A, B, C, D ) and functional dependency {AB –> C, C –> D, D –> A}. Relation R is decomposed into R1( A, B, C) and R2(C, D). Check whether decomposition is dependency preserving or not. 

Solution:

R1(A, B, C) and R2(C, D)

Let us find closure of F1 and F2
To find closure of F1, consider all combination of
ABC. i.e., find closure of A, B, C, AB, BC and AC
Note ABC is not considered as it is always ABC 

closure(A) = { A }  // Trivial
closure(B) = { B }  // Trivial
closure(C) = {C, A, D} but D can't be in closure as D is not present R1.
           = {C, A}
C--> A   // Removing C from right side as it is trivial attribute

closure(AB) = {A, B, C, D}
            = {A, B, C}
AB --> C  // Removing AB from right side as these are trivial attributes

closure(BC) = {B, C, D, A}
            = {A, B, C}
BC --> A  // Removing BC from right side as these are trivial attributes

closure(AC) = {A, C, D}
NULL SET


F1 {C--> A, AB --> C, BC --> A}.
Similarly F2 { C--> D }

In the original Relation Dependency { AB --> C , C --> D , D --> A}.
AB --> C is present in F1.
C --> D is present in F2.
D --> A is not preserved.

F1 U F2 is a subset of F. So given decomposition is not dependency preserving.

Question 1: Let R (A, B, C, D) be a relational schema with the following functional dependencies:

A ? B, B ? C,
C ? D and D ? B. 

The decomposition of R into 
(A, B), (B, C), (B, D)

(A) gives a lossless join, and is dependency preserving 

(B) gives a lossless join, but is not dependency preserving 

(C) does not give a lossless join, but is dependency preserving 

(D) does not give a lossless join and is not dependency preserving 

Refer to this for a solution. 

Question 2 R(A, B, C, D) is a relation. Which of the following does not have a lossless join, dependency-preserving BCNF decomposition? 

(A) A->B, B->CD 

(B) A->B, B->C, C->D 

(C) AB->C, C->AD 

(D) A ->BCD

 Refer to this for a solution. Below is the Quiz of the previous year’s GATE Questions. https://www.geeksforgeeks.org/dbms-gq/database-design-normal-forms-gq/

Imp: The 1NF, 2NF, and 3NF are valid for dependency-preserving decomposition.

Dependency Preserving Decomposition is a technique used in Database Management System (DBMS) to decompose a relation into smaller relations while preserving the functional dependencies between the attributes. The goal is to improve the efficiency of the database by reducing redundancy and improving query performance.

  1. In this technique, the original relation is decomposed into smaller relations in such a way that the resulting relations preserve the functional dependencies of the original relation. This is important because if the decomposition results in losing any of the original functional dependencies, it can lead to data inconsistencies and anomalies.
  2. To achieve dependency preserving decomposition, there are various algorithms available, such as the Boyce-Codd Normal Form (BCNF) decomposition and the Third Normal Form (3NF) decomposition. These algorithms are based on the concept of functional dependencies and are used to identify the attributes that should be grouped together to form smaller relations.
  3. The BCNF decomposition algorithm is used to decompose a relation into smaller relations in such a way that each resulting relation is in BCNF. BCNF is a higher normal form than 3NF and is used when there are multiple candidate keys in a relation.
  4. The 3NF decomposition algorithm is used to decompose a relation into smaller relations in such a way that each resulting relation is in 3NF. 3NF is a normal form that ensures that there are no transitive dependencies between the attributes of a relation.

Overall, dependency preserving decomposition is an important technique in DBMS for improving database efficiency while maintaining data consistency and integrity. It is important to choose the right decomposition algorithm based on the specific requirements of the database to achieve the desired results.


Previous Article
Next Article

Similar Reads

Lossless Join and Dependency Preserving Decomposition
Decomposition of a relation is done when a relation in a relational model is not in appropriate normal form. Relation R is decomposed into two or more relations if decomposition is lossless join as well as dependency preserving. Lossless Join DecompositionIf we decompose a relation R into relations R1 and R2, Decomposition is lossy if R1 ⋈ R2 ⊃ RDe
4 min read
Differentiate between Partial Dependency and Fully Functional Dependency
Fully Functional Dependency :If X and Y are an attribute set of a relation, Y is fully functional dependent on X, if Y is functionally dependent on X but not on any proper subset of X.Example -In the relation ABC->D, attribute D is fully functionally dependent on ABC and not on any proper subset of ABC. That means that subsets of ABC like AB, BC
3 min read
Join Dependency in Database
Join Dependency means re-creating the original Table by joining multiple sub-tables of the given Table. It is a further generalization of MVD(multi-valued Dependencies). When a relation R can be obtained by joining the R1, R2, R3..., Rn where R1, R2, R3..., Rn are sub-relations of R, it is called a Join Dependency.R1,R2,R3...Rn are the sub-relation
5 min read
Federated database management system issues
What is a Federated Database Management System? A Federated Database Management System (FDBMS) is a type of distributed database management system that allows users to access and manipulate data stored in multiple databases. It is a system that integrates data from different sources, providing a single view of the data to users. This type of system
9 min read
Personnel involved in Database Management System
Many persons are involved in the design, use, and maintenance of a large database with a few hundred users. Here we will consider people who may be called "Actors on the Scene", whose jobs involve the day-to-day use of a large database. Database Administrators: Administrating the primary (database) and secondary (DBMS and related software) is the r
5 min read
Introduction of DBMS (Database Management System)
A database is a collection of interrelated data that helps in the efficient retrieval, insertion, and deletion of data from the database and organizes the data in the form of tables, views, schemas, reports, etc. For Example, a university database organizes the data about students, faculty, admin staff, etc. which helps in the efficient retrieval,
8 min read
Structure of Database Management System
A Database Management System (DBMS) is software that allows users to define, store, maintain, and manage data in a structured and efficient manner. It acts as an intermediary between data and users, allowing disparate data from different applications to be managed. A DBMS simplifies the complexity of data processing by providing tools to organize d
8 min read
Advantages of Database Management System
Database Management System (DBMS) is a collection of interrelated data and a set of software tools/programs that access, process, and manipulate data. It allows access, retrieval, and use of that data by considering appropriate security measures. The Database Management system (DBMS) is really useful for better data integration and security. Advant
6 min read
Database Management System - GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
5 min read
Armstrong's Axioms in Functional Dependency in DBMS
Prerequisite - Functional Dependencies This article contains Armstrong's Axioms and how Armstrong's Axioms are used to decide about the functional dependency on the database. We will be also learning about the Secondary Rules and Armstrong Relations. We will learn each thing in detail. Before moving ahead, you must have a knowledge of Functional De
4 min read
Functional Dependency and Attribute Closure
Fundamental ideas in database management and design are functional dependency and attribute closure. They are essential to maintaining data integrity and building effective, organized, and normalized databases. Functional DependencyA functional dependency A->B in a relation holds if two tuples having the same value of attribute A also have the s
6 min read
How do you Check Functional Dependency Validity?
Answer: To validate functional dependency ensure a clear relationship, check for redundancy, and analyze data consistency using closure and transitivity.Understanding FD ConceptFunctional Dependency (FD) denotes that the value of one attribute determines another in a database. Ensuring Data Redundancy-FreePrioritize a redundancy-free dataset before
1 min read
Partial Dependency in DBMS
Database Management Systems (DBMS) design and optimize their databases for working, expecting partial dependency. It is something like a functional or strong dependency that makes it possible to show a constrained relationship between two or more attributes in a table. In this essay, we will discuss partial reliances, how to overcome them, and how
9 min read
Fully Functional Dependency in DBMS
In the case of database management systems (DBMS), knowledge of dependencies is vital for the base built on this and it is a must for the development of the database that is most useful and practical. Special interdependency, which is expressed in the schema of the database, is based on the rule of changing attributes by changing the rest of the sc
4 min read
What is Functional Dependency in DBMS?
Functional dependency in DBMS is an important concept that describes the relationship between attributes (columns) in a table. It shows that the value of one attribute determines the other. In this article, we will learn about functional dependencies and their types. What is Functional Dependency in DBMS?A dependency function (FD) is a database con
6 min read
Multivalued Dependency and Fourth Normal Form
In database management systems, normalization is an essential process to ensure that data is organized efficiently and effectively. Multivalued dependency (MVD) is a concept that helps to identify and eliminate data redundancy and anomalies, and Fourth Normal Form (4NF) is a normalization form that addresses the challenges associated with multivalu
5 min read
Multivalued Dependency (MVD) in DBMS
In Database Management Systems (DBMS), multivalued dependency (MVD) deals with complex attribute relationships in which an attribute may have many independent values while yet depending on another attribute or group of attributes. It improves database structure and consistency and is essential for data integrity and database normalization. MVD or m
3 min read
Properties of Relational Decomposition
When a relation in the relational model is not appropriate normal form then the decomposition of a relation is required. In a database, breaking down the table into multiple tables termed as decomposition. The properties of a relational decomposition are listed below : Attribute Preservation: Using functional dependencies the algorithms decompose t
3 min read
Lossless Decomposition in DBMS
The original relation and relation reconstructed from joining decomposed relations must contain the same number of tuples if the number is increased or decreased then it is Lossy Join decomposition. Lossless join decomposition ensures that never get the situation where spurious tuples are generated in relation, for every value on the join attribute
5 min read
Decomposition In DBMS
Decomposition refers to the division of tables into multiple tables to produce consistency in the data. In this article, we will learn about the Database concept. This article is related to the concept of Decomposition in DBMS. It explains the definition of Decomposition, types of Decomposition in DBMS, and its properties. What is Decomposition in
4 min read
Difference between Lossless and Lossy Join Decomposition
The process of breaking up a relation into smaller sub-relations is called Decomposition. Decomposition is required in DBMS to convert a relation into a specific normal form which further reduces redundancy, anomalies, and inconsistency in the relation. There are mainly two types of decompositions in DBMS Lossless join DecompositionLossy join Decom
5 min read
How to pre populate database in Android using SQLite Database
Introduction : Often, there is a need to initiate an Android app with an already existing database. This is called prepopulating a database. In this article, we will see how to pre-populate database in Android using SQLite Database. The database used in this example can be downloaded as Demo Database. To prepopulate a SQLite database in an Android
7 min read
Difference between Database Administrator and Database Architect
In the field of data management the position of a DBA and that of a Database Architect while sounding similar are in fact quite distinct. Although both jobs are crucial for maintaining the functionality and the protection of databases, both jobs engaged on various tasks connected with database management. A DBA is mainly involved in database admini
5 min read
Difference between Open Source Database and Commercial Database
Databases play a critical role in storing and managing structured data, with the help of a Database Management System (DBMS). They are broadly categorized into two types: open-source and commercial. Open-source databases, like MySQL and PostgreSQL, are freely available and allow customization, making them a popular choice for budget-conscious organ
6 min read
Difference between Database Administrator (DBA) and Database Engineer
Database Administrator is a user who is responsible for all duties related to the database like performance, optimization, backup, recovery, etc. Whereas the Data Engineer is the user who is responsible for developing the databases and he/she must ensure the proper functioning of the database. This article will provide an in-depth guide about the m
5 min read
Difference between Centralized Database and Distributed Database
As we know, databases are widely used for efficient storage, search, and other operations with data in the process of data management. Listening to the experience of using databases, two major categories are Centralized Databases and Distributed Databases. It is crucial to grasp the distinctions between these two types since every one of them posse
6 min read
Database Management Systems | Set 3
Following Questions have been asked in GATE 2012 exam. 1) Consider the following transactions with data items P and Q initialized to zero: T1: read (P) ; read (Q) ; if P = 0 then Q : = Q + 1 ; write (Q) ; T2: read (Q) ; read (P) ; if Q = 0 then P : = P + 1 ; write (P) ; Any non-serial interleaving of T1 and T2 for concurrent execution leads to (A)
3 min read
Database Management Systems | Set 4
Following Questions have been asked in GATE 2011 exam. 1. Consider a relational table with a single record for each registered student with the following attributes. 1. Registration_Number:< Unique registration number for each registered student 2. UID: Unique Identity number, unique at the national level for each citizen 3. BankAccount_Number:
4 min read
Database Management Systems | Set 5
Following Questions have been asked in GATE CS 2010 exam. 1) A relational schema for a train reservation database is given below. Passenger (pid, pname, age) Reservation (pid, class, tid) Table: Passenger pid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69 Table : Reservation pid class tid --------------- 0 AC 8200 1 AC 820
4 min read
Database Management Systems | Set 6
Following questions have been asked in GATE 2009 CS exam. 1) Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of T1 and T2 as given below: T1 = R1[X] W1[X] W1[Y] T2 = R2[X] R2[Y] W2[Y] S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y] S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y] S3 = R1[X] W1[X] R2[X] W1[Y] R2[Y] W2[Y] S1 = R1[X] R2[Y]R2[X
4 min read
Article Tags :