To learn andunderstand basic Indexing concepts. Problems Q 1. Consider thefollow
ID: 3611793 • Letter: T
Question
To learn andunderstand basic Indexing concepts.
Problems
Q 1. Consider thefollowing relation Cars:
Marks (10 + 10)
Brand TypeColor Risk
Suzuki Alto SilverMedium
Suzuki Mehran RedHigh
Toyota Crown BlackLow
Toyota Corolla RedMedium
Honda Accord SilverLow
Honda Civic BlackLow
BMW A BlackLow
I. Construct a bitmapindex for the attributes Brand and Color for this table.
II. Indicate how thesetwo bitmap-indices can be used to answer the query:
“Give the total number of red Toyota cars with amedium risk score”.
Explanation / Answer
Bitmap index for the attributes brand and color:
Brand
Color
Silver
Red
Black
Suzuki
1
0
0
Suzuki
0
1
0
Toyota
0
0
1
Toyota
0
1
0
Honda
1
0
0
Honda
0
0
1
BMW
0
0
1
The bit map indices help us to find the number of Red colorToyota cars available. From the above bitmap index values we cansay that there is only one Red color Toyota car. Now, we verifythis value with the risk score whether it is medium or not.
Hence, we have only one Red Toyota with medium risk score.
Brand
Color
Silver
Red
Black
Suzuki
1
0
0
Suzuki
0
1
0
Toyota
0
0
1
Toyota
0
1
0
Honda
1
0
0
Honda
0
0
1
BMW
0
0
1
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.