2,537 views

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}}$

### Subscribe to GO Classes for GATE CSE 2022

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
by
3 6 20
option D is correct. room, shift is a set of column that uniquely identify the database record.
by
2 9 21
Option D is correct as we cannot make only room as candidate key it may lead to ambiguity.
by
1

1
925 views