Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Draw the initial query tree for each of these queries, then show how the query tree is optimized (one rule at a time) by the
Draw the initial query tree for each of these queries, then show how the query tree is optimized (one rule at a time) by the algorithm outlined in chapter 19 and write the SQL query for the final optimized query tree.
Q1: List the lastnames of pair of authors who co-authored at least one book.
SELECT a1.AuthorLast, a2.AuthorLast FROM Author a1, Wrote w1, Author a2, Wrote w2 WHERE a1.AuthorNum = w1.AuthorNum and a2.AuthorNum = w2.AuthorNum and w1.BookCode = w2.BookCode and a1.AuthorNum < a2.AuthorNum;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started