Question: Consider the following database schema and then write the requested queries. AUTHOR ( id , name, address, country, age ) BOOK ( isbn , title,
Consider the following database schema and then write the requested queries.
AUTHOR id name, address, country, age
BOOK isbn title, numpages, publisher, year, genre, price
WRITESaid bisbn
SALES isbn year, numcopies
The underlined attributes form the key of the relation. Attribute isbn in SALES is a foreign key to BOOK. Attribute aid is a foreign key to AUTHOR, and bisbn is a foreign key to BOOK. Note that an author may have written several books alone or with other authors and that a book may have one or several authors. The table SALES gives the total number of copies sold by a certain book in a given year.
List the authors who have published a horror book and a scifi book
List the ids of authors who have written two or more books.
List the total sales per book, across years, with books identified by title.
Find the average number of books sold per year, for each year
Find the title of the most expensive book of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
