Consider the following relation tables fields with underline
Consider the following relation tables (fields with underline is primary keys): Author(Name, Country) Book(ISBN, Title, Publisher, Subject) Writes(Name, ISBN) Write the relational algebra for the following query: Give the titles of all books with \"Art\" subject Give the name of all authors who publish with \"Harding\" Give the name of all authors who have written books with \"Science\" subject Give the titles of all books written by U.S. authors Give the titles, ISBNs, and publishers of all books with \"Art\" subject whose authors live in the US.
Solution
1) Select title from Book where Subject like \'Art\';
2) Select w.name from writes w,book b where w.isbn=b.isbn and b.publisher like \'Harding\';
3) Select w.name from writes w,book b where w.isbn=b.isbn and b.Subject like \'Science\';
4) Select b.title from book b,writes w,author a where a.name=w.name and w.isbn=b.isbn and a.country like \'U.S\';
5) Select b.title,w.isbn,b.publisher from book b,writes w,author a where a.name=w.name and w.isbn=b.isbn and a.country like \'U.S\' and b.subject like \'Art\';
