Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write an SQL query for the attached. thank you Write the following questions as queries in SQL. Use only the operators discussed in class

image text in transcribed

Please write an SQL query for the attached. thank you

Write the following questions as queries in SQL. Use only the operators discussed in class - in particular, no outer joins. Type and format your answers. Before starting, make sure you understand the schema of the database. If you are in doubt about it, please ask the instructor. Assume a database with schema AUTHOR(name, age, address, nationality) BOOK (title, year, genre, price, num-pages, publisher) WRITES(aname, btitle royalty) where the table AUTHOR contains information about writers, and name is the primary key: BOOK contains information about books (their title, the year they were published, their price, the number of pages and the name of the publisher who published it!) and title is the primary key. Attribute genre is one of 'humor', 'biography', 'sci-fi'. 'horror' and so on. WRITES tells us which author has written which book(s) (so aname and btitle are foreign keys in WRITES)?, and what percentage of the book price they got in royalties. Note that an author may have written several books, and a book may have been written by several authors jointly: the key of WRITES is (aname.btitle). Write the following questions in Relational Algebra: 1. List the title and price of any book with (at least) one English author and one Australian author. 2. List the names of publishers who have published a biography or a humor book. 3. List the names of publishers who have published both a biography and a humor book. 1. List the names of publishers who have published at least 2 books. 5. List the names of publishers who have never published a biography

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Be familiar with the basic ways to manage capacity.

Answered: 1 week ago