Question: Consider the following relational schema and SQL query. The schema captures information about employees, departments, and company finances ( organized on a per department basis
Consider the following relational schema and SQL query. The schema captures information
about employees, departments, and company finances organized on a per department basis
Empeid: integer, did: integer, sal: integer, hobby: char
Deptdid: integer, dname: char floor: integer, phone: char
Financedid: integer, budget: real, sales: real, expenses: real
Consider the following query:
SELECT Ddname, Fbudget
FROM Emp E Dept D Finance F
WHERE EdidDdid AND DdidFdid AND Dfloor AND Esal AND Ehobby 'yodeling';
a points Identify a relational algebra tree or a relational algebra expression if you prefer
that reflects the order of operations a decent query optimizer would choose.
b Suppose that the following additional information is available: Nonclustering tree
indexes exist on Emp.did, Emp.sal, Dept.floor, Dept.did, and Finance.did. The system's
statistics indicate that employee salaries range from to employees enjoy
different hobbies, and the company owns two floors in the building. There are a total of
employees and departments each with corresponding financial information
in the database.
i points For each of the query's base relations Emp Dept, and Finance estimate the
number of tuples that would be initially selected from that relation if all of the nonjoin
predicates on that relation were applied to it before any join processing begins.
ii points Given your answer to the preceding question, list the join order ie the
order in which pairs of relations can be joined to compute the query result that a
relational query optimizer will consider.
iii. points What is the estimated number of tuples returned by the query?
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
