Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are presented a database/schema that looks like the following: Please write the following queries in sql utilizing relational algebra: - BOOK (isbn, title, num-pages,
You are presented a database/schema that looks like the following:
Please write the following queries in sql utilizing relational algebra:
- BOOK (isbn, title, num-pages, publisher, year, genre, price, aut-id). The first attribute is the primary key; the last one is a foreign key to AUTHOR. 1 - CUSTOMER(customer-id, name, address, city, state, zip, age). The first attribute is the primary key. - SALES (isbn, custid, num-copies, day, month, year, total). The first attribute is a foreign key to BOOK and the second a foreign key to CUSTOMER. The key of this table is the two foreign keys together. - AUTHOR (author-id, name, dob, nationality, address, city, state, zip). The first attribute is the primary key. Write the following queries in Relational Algebra: 1. List the title and publisher of all the books that have sold at least 100 copies at any time. 2. List the title and publisher of all the books that have been sold to a customer from the state of Kentucky. 3. Find the name and address of British authors who have written a sci-fi book (recall that 'sci-fi' is one value of genre). 4. List the name and address of authors who have written either a sci-fi book or a romance book (recall that 'sci-fi' and 'romance' are values of genre). 5. List the name and address of authors who have written a sci-fi book and a romance book. 6. List the name and address of authors who have never written a sci-fi book. 7. List the name and address of authors who have written at least two books. 8. List the name and address of authors who have written only sci-fi books (i.e. all the books they have written are sci-fi)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started