Consider the following schema: Publisher (name, phone, city), PK: name. Book (ISBN, title, year, published_by, previous_edition, price), PK: ISBN,...

70.2K

Verified Solution

Question

Programming

Consider the following schema:

Publisher (name, phone, city), PK:name.

Book (ISBN, title, year, published_by,previous_edition, price), PK: ISBN, FK: published_by refsPublisher, previous_edition refs Book.

Author (SSN, first_name, last_name,address, income), PK: SSN.

Write (aSSN, bISBN), PK: (aSSN,bISBN), FK: aSSN refs Author, bISBN refs Book.

Editor (SSN, first_name, last_name,address, salary, works_for, book_count), PK: SSN, FK: works_forrefs Publisher.

Edit (eSSN, bISBN), PK: (eSSN, bISBN),FK: eSSN refs Editor, bISBN refs Book.

Author_Editor (aeSSN, hours), PK:aeSSN, FK: aeSSN refs Author, aeSSN refs Editor.

Give SQL statements for the following plain English languagequeries based on the above schema.

Hint: You may use views to hold intermediate results.

  1. Show the number of books published in 2008 versus the number ofbooks published in 2009 for every publisher. The result should havethe following four columns: publisher_name, book_count_08,book_count 09, percentage of increase from 2008 to 2009

2. Provide an SQL UPDATE statementthat updates the book_count field of the Editor table by computingthe number of books edited by each editor using nested queries. (10pts)

3. For each publisher, find the titleof the book that it publishes with the largest number of editors.The output should have two columns - one is the publisher’ name andthe other is the title of the book found.

Answer & Explanation Solved by verified expert
4.3 Ratings (569 Votes)
Answer to Question 1 We are using correlated sub queries to find the solution There are two sub queries and both will be joined SELECT sub8PublisherName sub8bookcount08    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students