Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote