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
1
vote
1 answer

Understanding candidate key

Consider R(A,B,C,D,E) F = {BC->AE, A->D, D->C, ABD->E}. I need to find all candidate key of the schema. I know that BA,BC,BD are the keys, but i want to know how do discover them. I saw some answers in candidate keys from functional dependencies =…
user2637293
  • 333
  • 1
  • 5
  • 17
1
vote
3 answers

Minimum number of candidate keys for a relation?

My question is, is it necessary for a relation/table in database to have a candidate key and hence a primary key? Is it possible to have a relation where a row cannot be uniquely identified by any combination of attributes? If no, why? And if yes,…
Aditya Naidu
  • 697
  • 2
  • 7
  • 18
1
vote
1 answer

Representing multiple candidate keys in RM

I have problems in understanding why the following mapping from an ER-diagram to an ERM is correct, or, to be more precise complete. In the given example we have a ternary 1:1:N relationship between a project, a place and persons. Each entity has a…
Marvin
  • 9,164
  • 3
  • 26
  • 44
1
vote
1 answer

Oracle - Arbitrarily pick one of multiple rows based on single unique key

Good Morning! I am looking for a trick to maintain a unique list of keys where a one-to-many relationship can occur. Problem I am working with a horribly non-normalized database at work and unfortunately redesign is out of the question. I have a 1NF…
user2858650
1
vote
1 answer

Normal forms - 2nd vs 3rd - is the difference just composite keys? non trivial dependency?

I've viewed this answer at Difference between 2nd normalization phase / normal form and 3rd normalization phase / normal form but I don't understand the terms used (non-trivial functional dependency, superkey). Maybe 2nd normal form to relates to…
1
vote
0 answers

Access 2007: Delete Partially Duplicate Rows

I have data in an Excel spreadsheet that I import into Access 2007. There is a candidate key (CN). For those rows with the same CN, the data is different for all columns. Example below (real data has 100 columns and MsgNum might vary more often,…
daneshjai
  • 858
  • 3
  • 10
  • 17
1
vote
1 answer

What if I can not find a candidate key for my table (normalization)?

I am trying to understand how exactly normalization works and apply it in some specific project I have. I saw in several videos that the first step is to define a candidate key. I want to ask, what happens if none of the fields that I have (or a…
user1919
  • 3,818
  • 17
  • 62
  • 97
1
vote
3 answers

RDBMS keys confusion

I have some confuse about candidate key, primary key, mininal superkey. By definition: Primary key: only 1 attribute , so it must be minimal superkey and it's also a candidate key(because its minial superkey) First conclusion: If a key is primary…
runcode
  • 3,533
  • 9
  • 35
  • 52
0
votes
2 answers

How to implement priorities in SQL (postgres)

I'm writing some software that requires storing items in a database, the items need to have a 'priority' so we end up with ID | Name | Priority --------+--------------+---------- 1 | Pear | 4 2 | Apple | 2 …
Tony Million
  • 4,296
  • 24
  • 24
0
votes
0 answers

candidates is 0 but how record linkage python

I am trying to use record linkage to merge datasets by fuzzy matching. I am positive that their are no duplicate unique ids in either dataset. However I am getting the error that there are no potential candidates. How do I fix this error? Here is my…
0
votes
1 answer

Definition for relation to be in 3NF using canonical cover

We are using following definition of 3NF: A schema R is in third normal form (3NF) if for all FD α → β in F +, at least one of the following holds: α → β is trivial (i.e., β ⊆ α). α is a superkey for R Each attribute A in β – α is contained in a…
0
votes
1 answer

DataBase - Is this relation R is in BCNF and dependency preserving?

For R(A,B,C,D,E,G,H) here's the minimal cover: {A->E,D->H,D->G,E->C,G->B,G->C,H->D} Candidate keys: {AH,AD} By the definition of BCNF, none of the attributes on left side are SK or CK. Thus, it's not in BCNF. Is it safe to conclude that all of the…
0
votes
1 answer

how can I infer the candidate key from csv files

I have a folder with csv files with the following files: car.csv, person.csv, student.csv.... every files have columns. I am trying to read the column values and put them inside a list. this is my function: import pandas from itertools import chain,…
0
votes
1 answer

Determining candidate keys from functional dependencies: Exceptions where we don't use the minimal super key?

I'm currently trying to understand functional dependencies and how to derive can candidate keys from them. In an assignment I was given the following relation R Lecture Room Date NStudents Lecturer Tool Graphical DP 209 Wed.…
0
votes
0 answers

"No primary or candidate keys in referenced table", what am I not seeing?

I'm trying to create two simple tables and I'm getting this error on the foreign key. Can't figure out why, what I'm doing is pretty much straight forward. Maybe it's just that I'm too much of a newbie to see something obvious. The error is on…