Consider the relations Book(b_id, b_name, b_authorld/b_year, b_type) Author(a_id
ID: 3863452 • Letter: C
Question
Consider the relations Book(b_id, b_name, b_authorld/b_year, b_type) Author(a_id, a_name, a_country) located at Pittsburgh and NYC correspondingly. Specify two semi-join strategies to execute the following query depending on the order of relations in the semi-join operation (the result can be generated either in NYC or in Pittsburgh): select * from Book, Author where Book.b_authorld= Author, a_id and Account. a_country ='USA' Answer. Illustrate the benefit and disadvantages from using each of the semi-join considered in the previous problem with actual Customer and Account tuples. Explain how benefit depends on actual values of the Customer and Account tuples. Provide no more two sentences of explanation per strategy.Explanation / Answer
select *
from Book join Author
on Book.b_authorId = Author.a_id
and Author.a_country = 'USA'
This will have two conditions on the join itself. Where ever those columns matches then only particular records will be added to the result.
select *
from Author, Book
join Author.a_Id = Book.authorId
where Author.a_country = 'USA'
This will have only one condition on the join, So when Author.a_id matches with the Book.authorId those records willl be added to the result.
After that Where condition will fiter the result produced by the join operation.