
- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
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_ID | Emp_Name | Emp_Age | Emp_Location | Dept_ID | Dept_Name |
E001 | Jacob | 29 | Alabama | Dpt1 | Operations |
E002 | Henry | 32 | Alabama | Dpt2 | HR |
E003 | Tom | 22 | Texas | Dpt3 | Finance |
Decompose the above table into two tables:
<EmpDetails>
Emp_ID | Emp_Name | Emp_Age | Emp_Location |
E001 | Jacob | 29 | Alabama |
E002 | Henry | 32 | Alabama |
E003 | Tom | 22 | Texas |
<DeptDetails>
Dept_ID | Emp_ID | Dept_Name |
Dpt1 | E001 | Operations |
Dpt2 | E002 | HR |
Dpt3 | E003 | Finance |
Now, Natural Join is applied on the above two tables −
The result will be −
Emp_ID | Emp_Name | Emp_Age | Emp_Location | Dept_ID | Dept_Name |
E001 | Jacob | 29 | Alabama | Dpt1 | Operations |
E002 | Henry | 32 | Alabama | Dpt2 | HR |
E003 | Tom | 22 | Texas | Dpt3 | Finance |
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_ID | Emp_Name | Emp_Age | Emp_Location | Dept_ID | Dept_Name |
E001 | Jacob | 29 | Alabama | Dpt1 | Operations |
E002 | Henry | 32 | Alabama | Dpt2 | HR |
E003 | Tom | 22 | Texas | Dpt3 | Finance |
Decompose the above table into two tables −
<EmpDetails>
Emp_ID | Emp_Name | Emp_Age | Emp_Location |
E001 | Jacob | 29 | Alabama |
E002 | Henry | 32 | Alabama |
E003 | Tom | 22 | Texas |
<DeptDetails>
Dept_ID | Dept_Name |
Dpt1 | Operations |
Dpt2 | HR |
Dpt3 | Finance |
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.
- Related Articles
- Explain the algorithm to check lossy or lossless decomposition
- What is lossless join decomposition in DBMS?
- Difference between Lossy Compression and Lossless Compression
- What is Decomposition in DBMS?
- How does the Lossy Counting algorithm find frequent items?
- Differentiate between OS and DBMS files and OS and DBMS buffer manager
- Program to find minimum length of lossy Run-Length Encoding in Python
- Date and Time Functions in DBMS
- Security, Integrity and Authorization in DBMS
- Longest Chunked Palindrome Decomposition in python
- How to identify electrolyte and photo decomposition reactions?
- SELECT Statement and its Clauses in DBMS
- Difference between DDL and DML in DBMS.
- Difference Between Generalization and Specialization in DBMS
- Deadlocks in DBMS
