Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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