The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+18 votes
1.2k views
An instance of a relational scheme $R(A, B, C)$ has distinct values for attribute $A$. Can you conclude that $A$ is a candidate key for $R$?
asked in Databases by Veteran (52k points) | 1.2k views

2 Answers

+34 votes
Best answer

No.

$$\begin{array}{|c|c|c|} \hline \text {A} & \text {B} & \text {C}  \\\hline\text {1} & \text {5} & \text {6} \\\hline\text {2} & \text {4} & \text {7}\\\hline \text {3} & \text {4} & \text {5}\\\hline \end{array}$$

Suppose this is the relational instance at any point of time.

Now we can see that $A\to BC$ holds for this instance, hence $A^+=\{A,B,C\}.$ (For every unique value of $A$, values of $B$ and $C$ are distinct.

But FDs are defined on the schema and not on any instance. So, based on the state of any instance we cannot say what holds for schema (there can be other instances too for $R$). At the best we can say that $A \to BC$ MAY hold for $R.$

PS: If we have a single instance where $A \to BC$ is not holding, it is enough to say $A \to BC$ does not hold for the relation $R.$

answered by Active (3.6k points)
edited by
+17 votes
instance of a relation is just a snapshot at any instant of time it is not whole table. it may be possible in that instance of a relation some attribute behave like key but who knows in other instance of a relation this attribute is not key, some other attribute behave like key. so w/o whole table we cannot say anything about key of rel
answered by Active (4.3k points)
0
Well Explained

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,587 questions
54,193 answers
187,529 comments
71,148 users