functional-dependencies

A confusion about 2nd normal form for relation (R,N,S,C,X,P)

眉间皱痕 提交于 2019-12-11 04:59:23
问题 In a GATE question paper, I got a question to solve and I want your help to solve it. I have a relation E=(R,N,S,C,X,P) And I have some FDs P->C,X S->P C->P X->P According to the answer, the relation is in 2NF but I failed to get that. According to me, its primary key is NSR and S->P IS NOT SUPPORTING 2NF CONDITIONS. Could you help me with this? 回答1: None of the FDs (functional dependencies) determines R, N or S, so they must be prime, ie in every CK (candidate key). They determine all other

finding largest number of candidate keys that a relation has?

喜夏-厌秋 提交于 2019-12-11 04:58:04
问题 I am trying to solve this question which has to do with candidate keys in a relation. This is the question: Consider table R with attributes A, B, C, D, and E. What is the largest number of candidate keys that R could simultaneously have? the answer is 10 but i have no clue how it was done, nor how does the word simultaneously plays into effect when calculating the answer. 回答1: Sets that are not subsets of other sets. For example {A-B} and {A,B,C} can't be candidates keys simultaneously,

how to find the highest normal form for a given relation

天大地大妈咪最大 提交于 2019-12-11 03:52:35
问题 I've gone through internet and books and still have some difficulties on how to determine the normal form of this relation R(a, b, c, d, e, f, g, h, i) FDs = B→G BI→CD EH→AG G→DE So far I've got that the only candidate key is BHI (If I should count with F, then BFHI). Since the attribute F is not in use at all. Totally independent from the given FDs. What am I supposed to do with the attribute F then? How to determine the highest normal form for the realation R? 回答1: What am I supposed to do

Database extraneous attributes and decomposition

℡╲_俬逩灬. 提交于 2019-12-11 02:18:15
问题 I am kind of confused on the notion of extraneous attributes and a proper decomposition into 3NF. For example, I have the following relation: r(A,B,C,D,E,F) F = FD's F = {A-> BCD, BC-> DE, B->D, D->A} I want to compute the canonical cover in order to decompose it into 3NF using an algorithm. So I have to remove extraneous attributes from the FD's. I computed A+. B+, C+, D+ (A+ = ABCDE, B+ = BD, C+ = C, D+ = AD) I started trying to find extraneous attributes. First I looked at attributes in β

Haskell: shuffling data without functional dependencies

无人久伴 提交于 2019-12-10 13:05:26
问题 I'm trying to implement a Fisher-Yates shuffle of some data. This algorithm is easy to implement for one-dimensional arrays. However, I need to be able to shuffle data in a two-dimensional matrix. An approach which I think could generalize nicely to higher dimensional arrays is to convert my arbitrarily dimensioned matrix to a single-dimensional array of indices, shuffle those, and then reorganize the matrix by swapping the element at each index of this index array with the element at the

Lossless decomposition vs Dependency Preservation

北城以北 提交于 2019-12-10 09:37:50
问题 Does anyone of them implies the other? My logic is that if all dependencies are preserved, then there is no loss of information and similarly, if decomposition is lossless then no functional dependency must have been violated. So essentially, dependency preservation is a way to ensure that your decomposition is lossless. I am having a hard time accepting/denying it. So do both of these guarantee one another or are there cases where one can be achieved without the other? 回答1: In general these

Dependency preserving

a 夏天 提交于 2019-12-09 17:16:34
问题 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

Functional dependencies after normalization

三世轮回 提交于 2019-12-08 13:39:29
问题 I'm struggling to understand one aspect of the normalization process, I don't quite understand what to do with functional dependencies after I normalize a relation to 2NF (or 3NF). Let me describe it using an example. The exercise from my school book asks to normalize the relation to 2NF and then to 3NF. We are given a relation R=(ABCDEF) , F={AD->FE, BC->E, FEA->D, AC->DE, F->E, BD->A, F->C, ABC->AEF, B->F} Following the book, I minimized the Functional Dependencies to F = {AD->F, AC->D, BD-

Can a multivalued attribute have a primary key?

女生的网名这么多〃 提交于 2019-12-08 09:06:37
问题 Functional dependencies are the attributes that their values are determined in a unique way by another attribute.Given that, can a multivalued attribute be dependent upon a primary key? 回答1: "FDs are the attributes that their values are determined in a unique way by another attribute" is unintelligible. Find a way to say it correctly or how can you understand it? An attribute (or set of attributes) is functionally determined by a set of attributes. There is no such thing as a "multivalued

Converting Functional Dependency class to Type Family instances

孤人 提交于 2019-12-07 13:35:42
问题 Is it possible to create type family instances from a fundep class? For example, let's say that I have the class class A a b | a -> b with some instances (imported an external library) and want to create all corresponding instances for the type family type family A' a :: * such that A' a ~ b iff A a b , without having to manually copy and modify the instances from the external source. How would I do that (if it is possible)? My most promising attempt so far, class A' a where type A'_b a :: *