Lossless and Lossy Decomposition in DBMS


Decomposition in DBMS removes redundancy, anomalies and inconsistencies from a database by dividing the table into multiple tables.

The following are the types −

Lossless Decomposition

Decomposition is lossless if it is feasible to reconstruct relation R from decomposed tables using Joins. This is the preferred choice. The information will not lose from the relation when decomposed. The join would result in the same original relation.

Let us see an example −

<EmpInfo>

Emp_IDEmp_NameEmp_AgeEmp_LocationDept_IDDept_Name
E001Jacob29AlabamaDpt1Operations
E002Henry32AlabamaDpt2HR
E003Tom22TexasDpt3Finance

Decompose the above table into two tables:

<EmpDetails>

Emp_IDEmp_NameEmp_AgeEmp_Location
E001Jacob29Alabama
E002Henry32Alabama
E003Tom22Texas

<DeptDetails>

Dept_IDEmp_IDDept_Name
Dpt1E001Operations
Dpt2E002HR
Dpt3E003Finance

Now, Natural Join is applied on the above two tables −

The result will be −

Emp_IDEmp_NameEmp_AgeEmp_LocationDept_IDDept_Name
E001Jacob29AlabamaDpt1Operations
E002Henry32AlabamaDpt2HR
E003Tom22TexasDpt3Finance

Therefore, the above relation had lossless decomposition i.e. no loss of information.

Lossy Decomposition

As the name suggests, when a relation is decomposed into two or more relational schemas, the loss of information is unavoidable when the original relation is retrieved.

Let us see an example −

<EmpInfo>

Emp_IDEmp_NameEmp_AgeEmp_LocationDept_IDDept_Name
E001Jacob29AlabamaDpt1Operations
E002Henry32AlabamaDpt2HR
E003Tom22TexasDpt3Finance

Decompose the above table into two tables −

<EmpDetails>

Emp_IDEmp_NameEmp_AgeEmp_Location
E001Jacob29Alabama
E002Henry32Alabama
E003Tom22Texas

<DeptDetails>

Dept_IDDept_Name
Dpt1Operations
Dpt2HR
Dpt3Finance

Now, you won’t be able to join the above tables, since Emp_ID isn’t part of the DeptDetails relation.

Therefore, the above relation has lossy decomposition.

Updated on: 14-Sep-2023

27K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements