in Databases edited by
3,592 views
3 votes
3 votes

Considering the following table in a relational database : $$\begin{array}{|c|c|c|c|} \hline \textbf{Last Name} & \textbf{Rank} & \textbf{Room} & \textbf{shift} \\ \hline \text{Smith} & \text{Manager} & \text{234} & \text{Morning} \\ \hline  \text{Jones} & \text{Custodian} & \text{33} & \text{Afternoon} \\ \hline\text{Smith} & \text{Custodian} & \text{33} & \text{Evening} \\ \hline \text{Doe} & \text{Clerical} & \text{222} & \text{Morning} \\ \hline \end{array}$$

According to the data shown in the table, which of the following could be a candidate key of the table?

  1. $\text{{Last Name}}$
  2. $\text{{Room}}$
  3. $\text{{Shift}}$
  4. $\text{{Room, Shift}}$
in Databases edited by
by
3.6k views

3 Answers

8 votes
8 votes
Best answer
Candidate key:- must be able to uniquely determine every other attribute. i.e., whenever a candidate key value is repeated, all other values must repeat or in a set, candidate key cannot be repeated.

option

a:- Last Name cannot be key as smith value are repeated.

b.Room:- 33 value is repeated

c.shift:- morning repeated

d. Composite key Room+shift => Every tuple is now unique

234+morning

33+afternoon

33+evening

222+morning.

so Option D is right
edited by
2 votes
2 votes
option D is correct. room, shift is a set of column that uniquely identify the database record.
0 votes
0 votes
Option D is correct as we cannot make only room as candidate key it may lead to ambiguity.
Answer:

Related questions