Problem

Exercise 15.8 Consider the following relational schema and SQL query:Suppliers(sid: intege...

Exercise 15.8 Consider the following relational schema and SQL query:

Suppliers(sid: integer, sname: char(20), city: char(20))
Supply(sid: integer, pid: integer)
Parts(pid: integer, pname: char(20), price: real)

SELECT S.sname, P.pnameFROM Suppliers S, Parts P, Supply YWHERE S.sid = Y.sid AND Y.pid = P.pid AND      S.city = ‘Madison’ AND P.price ≤ 1,000
  1. What information about these relations does the query optimizer need to select a good query execution plan for the given query?
  2. How many different join orders, assuming that cross-products are disallowed, does a System R style query optimizer consider when deciding how to process the given query? List each of these join orders.
  3. What indexes might be of help in processing this query? Explain briefly.
  4. How does adding DISTINCT to the SELECT clause affect the plans produced?
  5. How does adding ORDER BY sname to the query affect the plans produced?
  6. How does adding GROUP BY sname to the query affect the plans produced?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 15