functional-dependencies

Dependency preserving

最后都变了- 提交于 2019-12-04 05:28:28
So I am looking over my database notes and material trying to refresh myself on the general concepts and terminology for upcoming interviews. I have gotten stuck at dependency however and lossless-join decompositions though. I have searched all over and see lots of mathy equations but I am looking for a plain and simple English response or example. I have a found a powerpoint from http://www.cs.kent.edu/~jin/DM09Fall/lecture6.ppt which 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),

Difference between canonical cover and minimal cover

喜夏-厌秋 提交于 2019-12-04 05:03:10
Apologies if this is a ridiculous question; I've searched high and low for an answer with no avail. I know how to calculate minimal cover; ie ensure each functional dependency only has one attribute on the the RHS, remove extratraneous/redudant lhs attributes by calculating closure of each examining all FD's, seeing if any can be removed (again by calculating closure) Is 'canonical' cover just another word for the same thing? A canonical cover is "allowed" to have more than one attribute on the right hand side. A minimal cover cannot. As an example, the canonical cover may be "A -> BC" where

How Type inference work in presence of Functional Dependencies

依然范特西╮ 提交于 2019-12-04 04:58:54
Consider the code below : {-# LANGUAGE MultiParamTypeClasses,FlexibleInstances,FunctionalDependencies,UndecidableInstances,FlexibleContexts #-} class Foo a c | a -> c instance Foo Int Float f :: (Foo Int a) => Int -> a f = undefined Now when I see the inferred type of f in ghci > :t f > f :: Int -> Float Now If I add the following code g :: Int -> Float g = undefined h :: (Foo Int a) => Int -> a h = g I get the error Could not deduce (a ~ Float) I am not able to understand what has happened here? The restriction Foo Int a should have restricted the type of h to Int -> Float as shown in the

Determine Keys from Functional Dependencies

僤鯓⒐⒋嵵緔 提交于 2019-12-03 18:21:01
问题 I'm taking a database theory course, and it's not clear to me after doing the reading how I can infer keys, given a set of functional dependencies. I have an example problem: Find all keys of the relation R(ABCDEFG) with functional dependencies AB → C CD → E EF → G FG → E DE → C BC → A Demonstrate your knowledge by identifying which of the following is a key. a. BCDEF b. ADFG c. BDFG d. BCDE Can someone walk me through how I should decompose the functional dependencies to conclude that some

Functional dependency and normalization

早过忘川 提交于 2019-12-03 03:51:20
问题 I am trying to find a great resource to study for functional dependency and normalization. Anyone have any idea where should I look to? I am having difficulty differentiating whether a FD is in 1NF, 2NF or 3NF? I've been reading Wikipedia and used Google search to find good research, but can't find any that explains it in simple terms. Maybe you all can share on how you learned FD's and normalization during your life as well. 回答1: A functional dependency defines a functional relationship

Minimal Cover and functional dependencies

左心房为你撑大大i 提交于 2019-12-03 01:04:36
问题 Given the following functional dependencies how would I compute the minimal cover: A -> B, ABCD -> E, EF -> GH, ACDF -> EG In the lecture notes it gives the derivation for the minimal cover but I do not understand it. For example for getting rid of ACDF -> E : A -> B => AACD -> BACD -> E => ACD -> E => ACDF -> E And then they say, similarly we do not keep ACDF -> G And then I understand that ABCD -> E is deduced to ACD -> E because A -> B , but I do not understand the formal process of how to

Lossless Join and Decomposition From Functional Dependencies

放肆的年华 提交于 2019-12-02 21:16:57
Suppose the relation R( K, L, M, N, P) , and the functional dependencies that hold on R are: - L -> P - MP -> K - KM -> P - LM -> N Suppose we decompose it into 3 relations as follows: - R1(K, L, M) - R2(L, M, N) - R3(K, M, P) How can we tell whether this decomposition is lossless? I used this example R1 ∩ R2 = {L, M}, R2 ∩ R3 = {M}, R1 ∩ R3 = {K,M} we use functional dependencies, and this is not lossless in my opinion, but a little bit confused. It helps if we demystify the concept of lossless decomposition a bit: it really just means that joining R1, R2 and R3 should yield the original R. Do

How to find a candidate key

谁说我不能喝 提交于 2019-12-02 13:31:56
问题 I have a relation A,B,C,D,E with functional dependencies 1) A->BC 2) CD->E 3) B->D 4) E->A Using 1 gives A,D,E and then using 4 will make it D,E Using 2 gives A,B,C,D and then using 3 gives A,B,C and using 1 gives A Using 2 gives A,B,C,D and using 1 gives A,D Using 4 gives B,C,D,E and using 2 gives B,C,D and using 3 gives B,C Using 3 gives A,B,C,E and using 1 gives A,E and using 4 gives E So I would have 5 super keys? (A, E, AD, BC, DE). And from my super keys I would pick the unique ones.

Skipping steps in Normalization?

爷,独闯天下 提交于 2019-12-02 08:06:35
Just curious: is there some reason why one cannot do all necessary normalizations in a single step? Isnt normalization ultimately the redrawing of the Functional Dependency (FD) graph? We start out with an FD diagram/graph and we want to end up with a graph (vertices are attributes, there is an edge between attributes a,b if b is FD on a ) representing a relation in (Edit) BCNF ? EDIT: What I mean is : we start with a FD graph , which is a graph pairing attributes a,b iff b is FD on A, i.e., we join a and b with an edge iff b=f(a). From this graph we want to obtain a graph (FD)_2 with certain

How to find a candidate key

核能气质少年 提交于 2019-12-02 05:14:38
I have a relation A,B,C,D,E with functional dependencies 1) A->BC 2) CD->E 3) B->D 4) E->A Using 1 gives A,D,E and then using 4 will make it D,E Using 2 gives A,B,C,D and then using 3 gives A,B,C and using 1 gives A Using 2 gives A,B,C,D and using 1 gives A,D Using 4 gives B,C,D,E and using 2 gives B,C,D and using 3 gives B,C Using 3 gives A,B,C,E and using 1 gives A,E and using 4 gives E So I would have 5 super keys? (A, E, AD, BC, DE). And from my super keys I would pick the unique ones. Since I can get A from E, I can remove A and AD(since DE is the same) and since I can get BC from A I can