Saving Dependencies

So, I look through my notes and database materials, trying to refresh general concepts and terminology for upcoming interviews. However, I am stuck in dependencies, but without loss. I searched everything and see a lot of mathematical equations, but I am looking for a simple and simple answer in English or an example.

I have a powerpoint from http://www.cs.kent.edu/~jin/DM09Fall/lecture6.ppt that illustrates an example that I cannot fully understand. It is posted below.

R = (A, B, C)F = {A → B, B → C) Can be decomposed in two different ways R1 = (A, B), R2 = (B, C) Lossless-join decomposition: R1 ∩ R2 = {B} and B → BC Dependency preserving R1 = (A, B), R2 = (A, C) Lossless-join decomposition: R1 ∩ R2 = {A} and A → AB Not dependency preserving (cannot check B -> C without computing R1 ⋈ R2) 

So, I understand that having A → B and B → C means that you have a “link” in each other, while A → B and A → C means that there is no link or link between B and C.

So,

  • Does Lossless-join decomposition mean that data as a whole is still intact? In both scenarios, you can still get both data, right? If not, please correct me! :)

  • What is the significance of the fact that compound B in C is in the second decomposition and how does this make it not preserving dependencies?

    • If A is deleted, you will simply have B and C without any relationship.

    • If B is deleted, you will still have A → C.

    • If C is deleted, you will still have A → B.

Because even in the first example, you still get similar results when deleting values.

  • If A is deleted, you will still have a relationship B → C.

    • If B is deleted, you will simply have A and C without any relationship.

    • If C is deleted, you will have a relation A → B.

So, anyway, if you delete every element, you still have two instances of the relationship and one instance of two elements that have no relations

My assumption would be that when deleting the “average person” relationship (is there a term for this), B in example 1 and A in example 2, is that you can still link example 1 A → B, then B → C, while in Example 2 you are stuck with A → B without connecting to A → C.

But, as you can see, I will now return to the square of the question of why this causes data dependency, and when I googling “what is a data dependency” or “data dependency examples”, it just doesn't make any sense to me.

If someone can help clarify this for me, we will be very grateful.

+7
database database-normalization functional-dependencies
source share
2 answers

Lossless Join does not mean that any of the tuples is lost or cannot be restored after the connection. A lossless connection means creating false tuples that result in "extra" rows (tuples) and "information" are said to be lost.

Assuming this is simple, I think that the dependency persists when we find both sides of the FD in the attributes of the same subcircuit. (someone please correct me if I am wrong).

+2
source share

Decomposing the relation R in R1 and R2 is a lossless decomposition if you can build R back by connecting the relations R1 and R2 (you can get R in the form R1 ⋈ R2).

In order for the decomposition of the ratio of R in R1 and R2 to be lossless, it must satisfy either of two conditions:

  1. R1 ∩ R2 -> R1 2. R1 ∩ R2 -> R2 

If the above relation does not make any sense, then think about it this way when you intersect 2 relations R1 and R2 and get common attributes, then if common attributes can define any of the relations, then this (these) common attribute is (are) a candidate key for the resulting relationship (think about why?), and therefore you can join using this candidate key with another relationship to get R.

As for the preservation of dependencies, the decomposition of the relation R is the preservation of the dependencies, if the Functional dependence of R can be obtained by taking the union of the functional dependence of all the decomposed relations.

+6
source share

All Articles