{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

It can be rewritten as create table t 1 as select f a

Info iconThis preview shows pages 9–10. Sign up to view the full content.

View Full Document Right Arrow Icon
boolean binary operator. It can be rewritten as create table t 1 as select f ( A 2 ), V from L 2 where P 1 2 group by V select ··· from L 1 , t 1 where P 1 and P 2 2 and A 1 op t 1 . A 2 where P 1 2 contains predicates in P 2 without selections involving correlation variables, and P 2 2 introduces the selections involving the correlation variables. V contains all the attributes that are used in the selections involving correlation variables in the nested query. 13.14 The set version of the semijoin operator is deFned as follows: r H s = P R ( r a H s ) where R is the set of attributes in the schema of r . The multiset version of the semijoin operation returns the same set of tuples, but each tuple has exactly as many copies as it had in r . Consider the nested query we saw in Section 13.4.4 which Fnds the names of all instructors who taught a course in 2007. Write the query in relational algebra using the multiset semjoin operation, ensuring that the number of duplicates of each name is the same as in the SQL query. (The semijoin operation is widely used for decorrelation of nested queries.) Answer: The query can be written as follows: instructor instructor . I D = teaches . I D ( h year = 2007 ( teaches ))
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page9 / 10

It can be rewritten as create table t 1 as select f A 2 V...

This preview shows document pages 9 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online