Question: Query Optimization Consider the following SQL query that finds all applicants who want to major in CSE, live in Seattle, and go to a school
Query Optimization
Consider the following SQL query that finds all applicants who want to major in CSE, live in Seattle, and go to a school ranked better than ie rank
tableRelationCardinality,Number of pages,Primary keyApplicants id name, city, sididSchools sid sname, sranksidMajor id majoridmajor
SELECT
Aname
FROM Applicants A Schools S Major M
WHERE Asid Ssid AND
Aid
Mid
AND Acity 'Seattle' AND Srank AND Mmajor 'CSE' And assuming:
Each school has a unique rank number srank value between and
There are different cities.
Applicants.sid is a foreign key that references Schools.sid.
Major.id is a foreign key that references
Applicants.id
There is an unclustered, secondary B tree index on
Major.id and all index pages are in memory.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
