Consider the following relation tables (fields with underline is primary keys):
ID: 3934483 • Letter: C
Question
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.Explanation / Answer
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';
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.