Question: Execute the following SQL and draw the query tree for the SQL. Describe what kinds of access methods are used for each table. Explain which

Execute the following SQL and draw the query tree for the SQL. 

Describe what kinds of access methods are used for each table. Explain which join method is used in each join operation.


SELECT /*+ GATHER_PLAN_STATISTICS */ C.lname, S.address, Pr.name
FROM Customer C, Purchase Pu, Item I, Store S, Product Pr
WHERE C.id = Pu.cid AND Pu.pid = I.pid AND Pu.ino = I.no AND I.sid = S.id AND I.pid = Pr.id
AND C.fname = 'Tesla';
SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (format=>'ALLSTATS LAST'));


Step by Step Solution

3.49 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

For your SQL query you have the following tables and join conditions 1 Customer C is joined with Pur... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!