functional-dependencies

Identifying Functional Dependencies II

怎甘沉沦 提交于 2020-05-12 01:56:13
问题 I was getting a little confused with the last post so I found a nice example which should clear things up. hireDate & carReg are the primary keys. So my question can anyone find any extra functional dependencies other than the ones I have identified below....Modifications also welcome: fd1 carReg -> make, model, outletNo, outletLoc fd2 custNo -> custName fd3 outletNo -> outletLoc fd4 model -> make (only if we assume a model name is unique to a make) fd5 carReg, hireDate -> make, model, custNo

How Type inference work in presence of Functional Dependencies

早过忘川 提交于 2020-01-12 18:46:53
问题 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

How Type inference work in presence of Functional Dependencies

自古美人都是妖i 提交于 2020-01-12 18:46:17
问题 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

Can a table be in 3NF with no primary keys?

我的未来我决定 提交于 2020-01-07 08:09:23
问题 1. A table is automatically in 3NF if one of the following holds: (i) If a relation consists of two attributes. (ii) If 2NF table consists of only one non key attribute. 2. If X → A is a dependency, then the table is in 3NF, if one of the following conditions exists: (i) If X is a superkey (ii) If A is a part of superkey I got the above claims from this site. I think that in both the claims, 2nd subpoint is wrong. The first one says that a table in 2NF will be in 3NF if we have all non-key

Is an FD(functional dependency) fully fd when x->y and z->y where z is not a subset of x?

做~自己de王妃 提交于 2020-01-06 14:40:56
问题 I have seen many examples about fully functional dependencies, but they use to say that: x->y such that y shouldn't be determined by any proper subset of x, x has to be a key. But, what if y is determined by an attribute other than the proper subset or subset of x. Suppose that I have a students table which consists of rollno(primary key), name, phone no unique not null, email unique not null. As rollno is a primary key, let it be x and take name as y. now x->y, but phone or email also

Functional Dependencies examples

情到浓时终转凉″ 提交于 2020-01-05 05:35:09
问题 So to sum it all up, i am having major difficulties understanding functional dependencies just by looking at abstract examples and would really appreciate some help of understanding with possible real life situations. I want to see if these functional dependencies is any BCNF violation. I have read alot of explainations but im still struggling with understanding fully and i cannot understand the full picture only by looking at characters such as the below. I feel like i need some real data to

Designing lossless-join, dependency preserving, 3NF database

青春壹個敷衍的年華 提交于 2020-01-03 19:42:50
问题 I need to design database which would keep track of the following attributes: stdnum // student number postcode // postal code phone_number // student phone number city // student address: city Also listed are functional dependencies: stdnum -> postcode stdnum -> phone_number postcode -> city phone_number -> city I need to find lossless-join, dependency preserving, 3rd normal form decomposition of the attributes . I have tried different decompositions but there was no one that obeys all

Designing lossless-join, dependency preserving, 3NF database

我只是一个虾纸丫 提交于 2020-01-03 19:41:12
问题 I need to design database which would keep track of the following attributes: stdnum // student number postcode // postal code phone_number // student phone number city // student address: city Also listed are functional dependencies: stdnum -> postcode stdnum -> phone_number postcode -> city phone_number -> city I need to find lossless-join, dependency preserving, 3rd normal form decomposition of the attributes . I have tried different decompositions but there was no one that obeys all

What did I do wrong? (Find FD from table)

两盒软妹~` 提交于 2020-01-01 22:28:28
问题 Here is the table Income: Here is my answer: costumer -> city costumer -> population price -> product price -> costumer price -> city price -> population city -> population population -> city but actually the answer is: (product, costumer) -> price costumer -> city city -> population costumer -> population What did I do wrong? I have been use by his method: https://www.youtube.com/watch?v=ddOP5D4fagg 回答1: We say that a FD (functional dependency) S -> T has a "determinant" set of attributes S

Difference between canonical cover and minimal cover

旧街凉风 提交于 2020-01-01 09:37:07
问题 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? 回答1: A canonical cover is "allowed" to have more than one attribute