edited by
9,863 views
47 votes
47 votes

There are five records in a database.
$$\begin{array}{|c|c|c|c|} \hline \textbf {Name} & \textbf {Age} & \textbf {Occupation} &  \textbf{Category } \\\hline \text{Rama} & \text{27} & \text{CON} & \text{A} \\\hline \text{Abdul} & \text{22} & \text{ENG} & \text{A} \\\hline \text{Jennifer} & \text{28} & \text{DOC} & \text{B} \\\hline \text{Maya} & \text{32} & \text{SER} & \text{D} \\\hline \text{Dev} & \text{24} & \text{MUS} & \text{C} \\\hline \end{array}$$

There is an index file associated with this and it contains the values $1, 3, 2, 5$ and $4$. Which one of the fields is the index built from?

  1. Age
  2. Name
  3. Occupation
  4. Category
edited by

2 Answers

Best answer
77 votes
77 votes
Indexing will be on Occupation field because Occupation field lexicographically sorted will give the sequence $1,3,2,5,4$.

Correct Answer: $C$
edited by
7 votes
7 votes
No Matter whether any Field Of Data File Is Sorted OR Not , INDEX IS ALWAYS SORTED.

Means For 5 Rows Index Key Value will be 1,2,3,4,5 .

Now depending On Which Field (Column) we need to perform indexing on , the block ptr will point to that

So u should Search For A Field Where Ascending Order Is 1,3,2,5,4.

So Basically Keys(1,2,3,4,5) will be associated with (1,3,2,5,4) which matches with lexicographic order in "Occupation".

                                                                                   (C,D,E,M,S)
Answer:

Related questions

23 votes
23 votes
1 answer
4
Kathleen asked Sep 25, 2014
7,245 views
Given two union compatible relations $R_1(A, B)$ and $R_2 (C, D)$, what is the result of the operation $R_1 \Join_{ A = C \wedge B = D} R_2$?$R_1 \cup R_2$$R_1 \times R_2...