functional-dependencies

candidate keys from functional dependencies

半世苍凉 提交于 2019-12-18 10:50:39
问题 Given the Relation R with attributes ABCDE. You are given the following dependencies: A -> B, BC -> E, and ED -> A. I already have the answer which is CDE, ACD, and BCD. I just need to know how to do it. Thanks. 回答1: A candidate key is a minimal superkey. In other words, there are no superflous attributes in the key. The first step to finding a candidate key, is to find all the superkeys. For those unfamiliar, a super key is a set of attributes whose closure is the set of all atributes. In

Decomposition to BCNF and set of super key

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:54:37
问题 So I have this set of relation AB->CDEF G->H,I ABJ->K C->L How should I decompose this? I am so confused. Am I supposed to find the set of super key first? 回答1: We can first convert the relation R to 3NF and then to BCNF. To convert a relation R and a set of functional dependencies( FD's ) into 3NF you can use Bernstein's Synthesis . To apply Bernstein's Synthesis - First we make sure the given set of FD's is a minimal cover Second we take each FD and make it its own sub-schema. Third we try

Determining candidate keys with functional dependencies simple

二次信任 提交于 2019-12-12 17:23:20
问题 Let R(A,B,C,D,E) be a relation schema and F = {A→C, B→D, C→E, E→A}, Find all candidate keys. I believe that there exists no CK's in this set due to not being able to map. B or D to any other relation besides B -> D . Does this mean that that there are no Candiate Keys? Although I am able to map A to all other entities besides B and D. 回答1: There are three candidate keys. B doesn't appear on the right-hand side of any functional dependency. That means B must be part of every candidate key. I

How to get around the Coverage Condition for Functional Dependencies without using -XUndecidableInstances

社会主义新天地 提交于 2019-12-12 10:56:25
问题 Wen using functional dependencies, I frequently hit the Coverage Condition . It is possible to lift it with UndecidableInstances , but I usually try to stay away from that extension. Here is a somewhat contrived example, that works without UndecidableInstances : {-# Language MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} data Result = Result String deriving (Eq, Show) data Arguments a b = Arguments a b class Applyable a b | a -> b where apply :: a -> b -> Result instance

Writing the functional dependency

帅比萌擦擦* 提交于 2019-12-12 06:48:39
问题 First module is User module. Administrators, students, lecturers or guests are users who benefit from the system and they take part in this module. Administrator will assign role as student or lecturer for each user. Each role has different privileges that is lecturer can upload the assignment and course materials, create the online quiz and single upload file. Users have information such as user ID, date of registration, date of latest logon, login account, password, first name, last name,

identifying the functional dependencies

被刻印的时光 ゝ 提交于 2019-12-12 04:34:07
问题 I have been reading up on database design and I am having some difficulty constructing functional dependency diagrams from tables. I have the following table. Each salesperson is identified by a salesperson’s number, and their sales activities are recorded for each month in the table. http://i.stack.imgur.com/2NXru.png I have made the following assumptions: Each Salesperson has a unique salesperson number Each Client has a unique client number Each product has a unique product number and

Listing functional dependencies - include transitive or multivalued?

穿精又带淫゛_ 提交于 2019-12-12 04:11:11
问题 I'm quite new to databases / SQL and have a practice question "what are the functional dependencies shown above?" From what I understand there are 4 dependencies: trivial functional, full functional, transitive and multivalued. Would the question be expecting all four types to be listed or only the first two? If only the first two then is there a special name for them or are they 'dependencies' whereas the first two in the list are functional dependencies? Many thanks 回答1: There are various

Is this decomposition dependency preserving?

為{幸葍}努か 提交于 2019-12-11 18:42:11
问题 I'm trying to figure out how to see if a decomposition is dependency preserving or not. The relation is: R(ABCDEF)and have the following FD's. AB -> CE,C -> EB,E -> D,C -> D. We then split the relation into: R1(BF), R2(ACB) and R3(CDE). Is this dependency preserving? I was under the impression that to calculate this, you do a closure on all of the left sides of the FD's. This give: AB+ = ABCEBD which includes AB -> CE C+ = CEBD which includes the FD's E+ = ED which include E->D So in my world

compiler failure to resolve Implicit types with bounds (sometimes)

空扰寡人 提交于 2019-12-11 13:27:17
问题 Edit : Last revision was deemed unhelpful as it did not contain necessary information that help narrow down my issue. hence the need to also include the AST. Below is a library in its entirety that allows parsing and writing of play-json 's json based on user defined schema; Similar to what Scala's slick offers for database columns to some extent: import scala.language.higherKinds import play.api.libs.functional.syntax._ import play.api.libs.json._ import scala.language.{higherKinds,

help with use of functional dependencies

你。 提交于 2019-12-11 05:19:47
问题 I have a question about functional dependencies. My understanding was that, for example, if I write class Graph g a b | g -> a, g -> b , then any specific g can be associated with only one type of a and b . Indeed, trying to declare two instance with the same g and different a and b does not work. However, the compiler (ghc) seems unable to use the dependency in the following case, class (Eq a, Eq b) => Graph g a b | g -> a, g -> b where edges :: g -> [b] src :: g -> b -> a dst :: g -> b -> a