Decomposition in DBMS? Types, Advantages, Properties, Issues
Decomposition in DBMS? Types, Advantages, Properties, Issues: Decomposition can be defined as a database management system process for dividing a single relation into multiple sub-relations. Its main purpose is to break down the functions of a company into fine levels of detail. It eliminates the anomalies and redundancy from the database by breaking it up into many different tables. These problems are often associated with bad designs that are pretty common these days in organizations.
Also See: What is Serializability in DBMS?
Decomposition in DBMS? Types, Advantages, Properties, Issues
In this post, we will talk about the decomposition in DBMS with proper detailing to ensure the readers clearly understand what it is. Let’s scan the full article and get answers to all your queries!
Also See: DATA TYPES IN SQL
Types of Decomposition?
There are two major types of decomposition about which we have mentioned in detail below:
-
Lossy Decomposition
In a Lossy Decomposition, the relation needs to be decomposed into two or more relational schemas. There is no way that loss of information can be avoided during the retrieval of the original relation. Let’s understand this technique by checking the following example:
<EmpDetail>
Emp_ID | Emp_Name | Emp_DOB | Emp_Position | Dep_ID | Dept_Name | Employ_Floor |
M001 | Manu | 15/02/92 | Manager | IUY1 | Operations | First |
M002 | Priya | 23/02/93 | Counselor | IUY2 | Finance | Second |
The data is further decomposed into two different tables
<EmpInfo>
Emp_ID | Emp_Name | Emp_DOB | Emp_Position | Dep_ID | ||||
M001 | Manu | 15/02/92 | Manager | IUY1 | ||||
M002 | Priya | 23/02/93 | Counselor | IUY2 |
Also See: What is data Extraction and Tools in DBMS?
Dept_Name | Employ_Floor |
Operations | First |
Finance | Second |
There won’t be any need to join the tables mentioned above as Dept_Name isn’t a component of Employ_Floor relation.
-
Lossless Decomposition
Lossless decomposition can be defined as the decomposition process where a single relation is transformed into multiple relations in such a way that they can be joined naturally if returned to the original relation. It is considered a perfect option for eliminating redundancy from the databases without affecting the original data. In simple words, it becomes easier to reconstruct the relation from modified tables in the lossless decomposition.
There is a pretty straightforward process used for choosing the common element in this type of decomposition. It is also known for non-additive decomposition in the DBMS world. This decomposition is defined concerning a particular set of dependencies. Let’s understand this thing with a proper example below:
Also See: Difference Between DBMS and RDBMS: DBMS Vs RDBMS
Consider there is a table named “Candidate” having multiple attributes like name, class, and roll number, and marks.
Name | Class | Roll Number | |||
Hritik | 9th | 111 | |||
Sonia | 10th | 222 | |||
Mandeep | 12th | 333 |
This process decomposes the relation into two different relations, named Cand_name and Cand_dept:
Name | Class |
Hritik | 9th |
Sonia | 10th |
Mandeep | 12th |
Name | Roll Number |
Hritik | 111 |
Sonia | 222 |
Mandeep | 333 |
Now, if we join both these relations, the resultant relation Cand_stu will look like the below table:
Name | Class | Roll Number | |||
Hritik | 9th | 111 | |||
Sonia | 10th | 222 | |||
Mandeep | 12th | 333 |
Also See: What is cardinality, Types With Example IN DBMS
You won’t see any spurious tuples while performing the lossless decomposition in any manner.
Advantages of decomposition in DBMS?
There is tremendous sort of advantages offered by decomposition about which we have mentioned in detail below:
- Easy use of Codes
The availability of decomposition makes it easier for programs to copy and reuse important codes for other works in DBMS. It only not helps in saving lots of time but also makes things convenient for the users.
- Finding Mistakes
Another reason the programmers opt for decomposition is to allow them conveniently complete complex programs. The mistakes are quite easier to find with this sort of programming.
- Problem Solving Approach
It is considered a perfect problem-solving strategy using which complex computer programs can be written easily. The users can precisely join tons of code together for adequate results.
- Eliminating Errors
The biggest advantage of having decomposition in DBMS is eliminating the inconsistencies and duplication to a greater extent. The data can be easily identified in cases when decomposition happens in DBMS.
Also See: Explain Database Schema and its Types
Properties of decomposition
The programmers must be aware of the main properties of decomposition in DBMS. We have mentioned the major ones in detail below:
- Attribute Preservation
The functional dependencies decompose the universal relation that attributes preservation of decomposition.
- Dependency Preservation
Dependency preservation can be defined as the functionality that features directly in the relation schemas. There is a chance of dependency loss if the decomposition is not preserved.
- No Redundancy
It is used for removing a few of the issues related to improper design, such as redundancy, anomalies, and inconsistencies. There are chances of information loss when the relation doesn’t have proper decomposition.
Also See: Different Sql Functions With Examples
Issues of decomposition in DBMS?
There are many problems regarding the decomposition in DBMS mentioned below:
- Redundant Storage
Many instances where the same information gets stored in a single place can confuse the programmers. It will take lots of space in the system.
- Insertion Anomalies
It isn’t essential for storing important details unless some kind of information is stored in a consistent manner.
- Deletion Anomalies
It isn’t possible to delete some details without eliminating any sort of information.
Also See: Data Definition language (DDL ) in DBMS with Examples
Conclusion
We believe everyone understands what really decomposition is. This technology is very helpful in removing tons of problems related to design in DBMS. You can get rid of many things like anomalies and redundancy with the help of decomposition. If you have any queries related to this prospect, please write about it in the comment section.
Leave a Reply