---
# System prepended metadata

title: PID-536

---

To verify if the given decomposition is a lossless-join decomposition, we need to check if the natural join of the two decomposed relations, `Student` and `R2`, results in the original relation `StudentHostel`. 

The common attribute between the two relations is `StudID.` We need to check if `StudID` is a candidate key or superkey in either relation `Student` or R2, or both. 

From the given functional dependencies, we can see that `StudID` is a candidate key in relation `Student`, as `StudID` determines both `StudName` and `StudDOB.` 

Also, from the functional dependency (`StudDOB, HostelNumber) -> HostelName`, we can see that `StudDOB `and `HostelNumber `together determine `HostelName.` Therefore, `HostelNumber` is not a candidate key or superkey in relation `R2.` 

Since `StudID` is a candidate key in relation `Student,` and it is also a common attribute in both relations, we can conclude that the decomposition is a `lossless-join` decomposition. 

To verify if the given decomposition is a dependency-preserving decomposition, we need to check if all the functional dependencies in the original relation `StudentHostel` can be enforced by the decomposed relations `Student` and `R2`. 

From the given functional dependencies, we can see that `StudID -> StudName and StudID -> StudDOB` hold in relation `Student`. Also, `HostelName -> StudID` holds in relation `R2`. 

From the functional dependency (StudDOB, HostelNumber) -> HostelName, we can see that HostelName is dependent on both StudDOB and HostelNumber. Therefore, we need to check if this dependency can be enforced by the decomposed relations. 

We can create a new relation `R3 = (StudDOB, HostelNumber, HostelName)` from the attributes and functional dependency `(StudDOB, HostelNumber) -> HostelName. `

Now, we can see that the original relation `StudentHostel` can be reconstructed by performing a natural join of the three decomposed relations Student, `R2`, and `R3,` as follows:

`(Student ⋈ R2) ⋈ R3`

Therefore, all the functional dependencies in the original relation can be enforced by the decomposed relations, and we can conclude that the given decomposition is a dependency-preserving decomposition.