0% found this document useful (0 votes)
9 views4 pages

Understanding Lossless Decomposition in DBMS

Nice
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Understanding Lossless Decomposition in DBMS

Nice
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Lossless Decomposition

ssIn database management systems (DBMS), lossless


decomposition refers to the process of breaking down a relation
(table) into smaller relations without losing any information. This
is crucial in database normalization, particularly in achieving
higher normal forms like Third Normal Form (3NF) or Boyce-Codd
Normal Form (BCNF). Lossless decomposition ensures that the
original data can be reconstructed from the smaller relations
without any loss of information.

There are two main methods for achieving lossless


decomposition: dependency preservation and functional
dependency.

1. Dependency Preservation:
- In this method, the decomposition of a relation into smaller
relations ensures that all the functional dependencies (FDs) that
held in the original relation are preserved in the decomposed
relations.
- Dependency preservation can be achieved through techniques
such as the synthesis algorithm or through careful analysis of the
functional dependencies in the original relation.

2. Functional Dependency:
- This method relies on the concept of functional dependencies
to ensure lossless decomposition.
- If a relation R is decomposed into relations R1 and R2, the
common attributes between R1 and R2 should form a candidate
key (or super key) of at least one of the decomposed relations.
- By ensuring that the common attributes between the
decomposed relations form a key in at least one of the relations,
lossless decomposition is achieved.

In practical terms, lossless decomposition is usually carried out


during the normalization process when designing a relational
database schema. It helps to eliminate redundancy and anomalies
while maintaining data integrity. It's worth noting that lossless
decomposition is a necessary condition, but it's not always
sufficient for achieving a desirable level of normalization.
Achieving higher normal forms may require additional steps
beyond lossless decomposition, such as ensuring that all non-key
attributes are fully functionally dependent on the primary key.
Sure, let's consider an example table called "Employee" with attributes
EmployeeID, EmployeeName, Department, and Salary.
EmployeeID | EmployeeName Department Salary

1 john HR 50000
2 mary IT 60000
3 rose HR 55000
4 tony FINANCE 70000
5 ron IT 62000

Now, let's say we want to decompose this table into two smaller tables:
Employee_Info and Employee_Salary. We can do this in a way that ensures
lossless decomposition.

Employee_Info
EmployeeID EmployeeName Department
1 john HR
2 mary IT
3 rose HR
4 tony FINANCE
5 ron IT
Employee_Salary:
EmployeeID Salary
1 50000
2 60000
3 55000
4 70000
5 62000

In this decomposition:

 Both Employee_Info and Employee_Salary have a common attribute


EmployeeID, which acts as a foreign key in Employee_Salary
referencing the primary key in Employee_Info.
 The original Employee table can be reconstructed by joining
Employee_Info and Employee_Salary using the EmployeeID attribute.
 Hence, this decomposition satisfies the criteria for lossless
decomposition.

LOSSY DECOMPOSITION
In contrast to lossless decomposition, where the original data can be
reconstructed without any loss of information, lossy decomposition involves
breaking down a relation (table) into smaller relations where some
information is lost in the process. This is typically done to optimize certain
aspects of the database design, such as reducing storage requirements or
improving query performance. However, it comes at the cost of losing some
data integrity or accuracy.

Here's an example of lossy decomposition:

Consider the same Employee table as before:

EmployeeID | EmployeeName Department Salary

1 john HR 50000
2 mary IT 60000
3 rose HR 55000
4 tony FINANCE 70000
5 ron IT 62000

Now, let's say we want to decompose this table into two smaller tables:
Employee_Info and Employee_Salary. However, instead of preserving the
relationship between EmployeeID and Salary, we decide to split the data
based on different criteria, such as grouping employees by their
departments:

Employee_Info:

EmployeeID EmployeeName Department


1 john HR
2 mary IT
3 rose HR
4 tony FINANCE
5 ron IT
Employee_Salary:
Department AvgSalary
HR 52500
IT 61000
FINANCE 70000

In this decomposition:

 We've lost the individual salary information for each employee.


 Instead, we've summarized the salary information by department,
storing only the average salary for each department in the
Employee_Salary table.
 While this decomposition may save storage space and simplify certain
queries related to average salaries by department, it comes at the
expense of losing the exact salary information for individual
employees.

Lossy decomposition is generally avoided in most database designs unless


there are specific performance or storage constraints that justify sacrificing
some data integrity or accuracy.

You might also like