Questions tagged [candidate-key]

A key is a set of attributes that is irreducibly unique and non-nullable within a table. Irreducible means that all the attributes of the key are necessary to guarantee uniqueness - remove any one attribute and the uniqueness property would be lost. A key may consist of zero, one or more attributes and a relational table (relation variable) must have at least one key and may have more than one.

A key is a set of attributes that is irreducibly unique and non-nullable within a table. Irreducible means that all the attributes of the key are necessary to guarantee uniqueness - remove any one attribute and the uniqueness property would be lost. A key may consist of zero, one or more attributes and a relational table (relation variable) must have at least one key and may have more than one.

97 questions
0
votes
0 answers

Computing the closure under a set of FDs

I am confused on how to compute the closure under a set of FDs. The actual question that I have is Relation R{A, B, C, D, E} satisfies the following FDs: A→D AB → C E→B Compute the closure of {A,E}+ under this set of FD. Also what is the candidate…
0
votes
2 answers

Subset of a candidate key

As we know a candidate key is a column or combination of columns that uniquely identifies the rows in a relation. Suppose I have a relation in which candidate keys are combinations of columns. I want to ask, is it possible that a subset of a…
a Learner
  • 4,944
  • 10
  • 53
  • 89
0
votes
2 answers

Confused about third normal form: a table having more than one candidate key

I was studying normalization and trying to implement it on some examples. I was doing third normal form, which from what I understand is: "A relation is in 3NF if it's in 2NF and doesn't have any transitive dependencies". I got stuck on an example,…
0
votes
1 answer

( MVC3/Entity Framework) How to perform CRUD operation in a database that uses Candidate keys as foreign keys

I am a complete beginner in MVC3 and web development in general. My client database uses unique candidate key of one table as foreign key of another. I cannot change the way the database is designed whatsoever. I have models derived from the…
0
votes
1 answer

How to change primary from one attribute to another. mysql

I have a database in which I have declared a primary key. Later on in implementing the database, I realized that I will have to create an auto-incrementing surrogate key and switch my current primary key to that, as my current primary key will…
0
votes
2 answers

Find candidate key from functional dependancy

For a relation {A,B,C,D} with the following functional dependancies - A -> BCD B -> C CD -> A Using a particular method i found on one of the sites, i am getting the candidate key as ABCD. Is that right ? What is the correct candidate key(s) ?
Cygnus
  • 3,222
  • 9
  • 35
  • 65
0
votes
1 answer

How to add a GUID (Not a PK) to an existing entity that already has a PK(Integer) in JPA Hibernate Mapping

I already have a entity class with id as Integer. As requirement we need to add a GUID to this that wont be PK for now. But should get auto populated whenever a entity is created new. (Existing will have this new Column GUID as NULL). GUID is not…
Monika
  • 21
  • 1
  • 5
-1
votes
1 answer

NULL values in candidate keys

I'm wondering whether a attribute can have multiple NULL values and still be a candidate key. Let's say we have a table with 3 columns, airport_id, airport_name, IATA_code. Primary_key is a airport_id. IATA_code is not always provided for an airport…
Pablo
  • 127
  • 5
-1
votes
1 answer

3NF Normalization and Decomposition

I am currently in a DB class and working through Normalization, and am running into some trouble. Am hoping I can get some assistance working through this. I have searched for the last 30 min and haven't found anything that helps solve my question,…
-1
votes
1 answer

Find 3 minimal keys in the following relation

I am trying to understand how to find minimal keys. The assignment provides me with the following task: Find 3 minimal keys in relation (each key is a set of attributes). R (a, b, c, d, e) a -> b bc -> d de -> a The answer is: (a, c, e) (b, c,…
Gabriele
  • 737
  • 2
  • 8
  • 20
-1
votes
2 answers

Why is XY not a candidate key?

I have a relation R(V,W,X,Y,Z) with functional dependencies V → W WX → Z ZY → V Since X and Y are not on the LHS, I found the closure of {XY} to equal {V,W,X,Y,Z}, making XY a candidate key. When I checked my answer using this tool, it said XYV,…
ajjohnson190
  • 494
  • 2
  • 7
  • 21
-1
votes
1 answer

If there aren't any candidate keys with 1 attribute how do i find the composite candidate keys for a relation?

I have trouble finding the candidate keys of a relation when there aren't any keys with only 1 attribute, so I have to find composite candidate keys. I have the relation R(A, B, C, D, E, F, G, H, I, J, K) and the FDs: A, B → D A → C, E B→ G G → H,…
-1
votes
2 answers

What is the difference between primary key, candidate key and super key in terms of functional dependency

What is the difference between primary key, candidate key and superkey in terms of functional dependency? I know the difference, but I don't know their difference in terms of functional dependencies.
-1
votes
1 answer

How can I find candidate keys?

Example: Let R = (A, B, C, D) Let F = {C -> AD, AB -> C} Then how can I find the candidate keys? The answer is {AB, BC} Why?
-1
votes
1 answer

Determining all candidate key given a universal set of attributes and a list of functional dependencies

Right now I have implemented following algorithm in java for determining all possible candidate keys which is working fine. The link is below:- http://shubhamshoundic.blogspot.com/2012/08/an-algorithm-to-find-all-possible.html But in worst case,…
GRaw
  • 1
  • 1