Question 3Consider a tablestudentswith attributesID, name, major, yob, state, ..
ID: 3743362 • Letter: Q
Question
Question 3Consider a tablestudentswith attributesID, name, major, yob, state, .... Assume the universityhas 20,000 students in 50 majors. Students come from 8 different states. Assume uniform distribution.Assume the file has 5,000 blocks, and has a primary index on ID and secondary indexes on major, yob,and state.
Discuss how each of the following queries can be executed, and estimate the number of block reads andwrites. Assume lowest level of each index is on disk, while upper levels are in memory. Write down anyother assumption you are making.
(a) select * from students where ID = 123456.
(b) select * from students where major = ’Computer Science’
(c) select * from students where major = ’Computer Science’ and state = ’NC’
Explanation / Answer
If you have any doubts, please give me comment...
select * from students where state = ’NC’ and yob=1993;
select * from students where major = ’Computer Science’ and and yob=1993;
select * from students where major = ’Computer Science’ and state = ’NC’ and yob=1993;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.