Database Multiple Choice Questions on “Selection Operation”.
1. In query processing, the ___________ is the lowest-level operator to access data.
a) Index Search
b) Linear search
c) File scan
d) Access paths
Answer: c
Clarification: File scans are search algorithms that locate and retrieve records that fulfill a selection condition.
2. In a ____________ the system scans each file block and tests all records to see whether they satisfy the selection condition.
a) Index Search
b) Linear search
c) File scan
d) Access paths
Answer: b
Clarification: An initial seek is required to access the first block of the file.
3. Index structures are referred to as __________ since they provide a path through which data can be located and accessed.
a) Index Search
b) Linear search
c) File scan
d) Access paths
Answer: d
Clarification: A primary index is an index that allows the records of a file to be read in an order that corresponds to the physical order in the file.
4. Search algorithms that use an index are referred to as
a) Index Search
b) Linear search
c) File scan
d) Access paths
Answer: a
Clarification: Selection predicates are used to guide in the choice of the index to use in processing the query.
5. Which algorithm uses equality comparison on a key attribute with a primary index to retrieve a single record that satisfies the corresponding equality condition.
a) A2
b) A4
c) A5
d) A6
Answer: a
Clarification: A2 – primary index, equality on key.
6. The strategy can retrieve a single record if the equality condition is on a key; multiple records may be retrieved if the indexing field is not a key is
a) A2
b) A4
c) A5
d) A6
Answer: b
Clarification: A4 – Secondary index, equality.
7. The algorithm that uses a secondary ordered index to guide retrieval for comparison conditions involving <,≤,≥, or > is
a) A2
b) A4
c) A5
d) A6
Answer: d
Clarification: A6 – Secondary index, comparison.
8. The ___ algorithm scans each index for pointers to tuples that satisfy an individual condition.
a) A2
b) A4
c) A9
d) A6
Answer: c
Clarification: A9 – Conjunctive selection by an intersection of identifiers.
9. If access paths are available on all the conditions of a disjunctive selection, each index is scanned for pointers to tuples that satisfy the individual condition. This is satisfied by
a) A10
b) A7
c) A9
d) A6
Answer: a
Clarification: A10 – Disjunctive selection by union of identifiers.
10. Conjunctive selection using one index. This is
a) A10
b) A7
c) A9
d) A6
Answer: b
Clarification: To reduce the cost of A7 we choose a i and one of algorithms A1 through A6 for which the combination results in the least cost for i (r ). The cost of algorithm A7 is given by the cost of the chosen algorithm.