2.5k views

There are five records in a database.

 Name Age Occupation Category Rama $27$ CON A Abdul $22$ ENG A Jennifer $28$ DOC B Maya $32$ SER D Dev $24$ MUS C

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 | 2.5k views
0
• What if there was some field in the table given above, whose values were in-fact 1,3,2,5 and 4 ?
•  In the question - "Index file associated with this and it contains the values 1,3,2,5 and 4." Are these "values" the record pointers ? (I am assuming as such).

Indexing will be on Occupation field because Occupation field lexicographically sorted will give the sequence $1,3,2,5,4$.
edited by
+8
The ordering of index records if Occupation attribute is choosed.

['CON' (1) , 'DOC' (2) , 'ENG'(3) , 'MUS' (4) , 'SER'(5)]

For other fields ,

Age is choosen,

22 gets index value 1, but from the given database 27 should get, hence not for Age Attribute.

Similar reason for Name attribute.

Category attribute is not as it contains duplicate values.

1
2