Consider the following relation tables (fields with underline is primary keys):
ID: 3936546 • 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
a) select title from books where subject = 'Art';
b) select a.name from authors a
join writes w on a.name=w.name
join books b on b.isbn = w.isbn
where b.publisher = 'Harding';
c) select a.name from authors a
join writes w on a.name=w.name
join books b on b.isbn = w.isbn
where b.subject = 'Science';
d) select b.title from books b
join writes w on b.isbn = w.isbn
join authors a on a.name=w.name
where a.country ='U.S.';
e) select b.title,b.ISBN,b.publisher from books b
join writes w on b.isbn = w.isbn
join authors a on a.name=w.name
where a.country ='U.S.' and b.subject='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.