Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a SQL query to find the top - rated book titles along with their authors. Consider only books with reviews, and for each book,

Write a SQL query to find the top- rated book titles along with their authors. Consider only books with reviews, and for each book, calculate the average rating of the books that are published in the same year (including the book itself). Return the book title, author name, and the calculated average rating. Sort the results in descending order by the average rating.
Tables Schema as Below:
authors
columnName dataType
id INT
name VARCHAR(255)
birth_year INT
death_year INT
book
columnName dataType
id INT
author_id INT
title VARCHAR(255)
publish_year INT
publishing_house VARCHAR(255)
rating DECIMAL(3,2)
book_review
columnName dataType
book_id INT
review TEXT
author VARCHAR(255)

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions