Write SQL query based on the above dataset for below question: (i) Write a query to display
Question:
Write SQL query based on the above dataset for below question:
(i) Write a query to display the number of books that are currently checked out (not available) by book subject. Sort the results by the number of books (ascending).
(ii) Write a query to display the book subject and the number of book titles within each subject. Sort the output in ascending order of the book subject.
(iii) Write a query to display book titles and the number of authors for books with more than one author. Sort the results by the ascending order of the number of authors.
(iv) Write a query to display book subject, book title, checkout number, checkout date, and due date, for all programming and database books. Sort the output by the ascending order of the book title. Within matching titles, order by the checked out date (ascending).
(v) Write a query to display the lowest, highest, and average book cost.
(vi) Write a query to generate a list of authors who were born between 1980 to 1990. Display the author's birth year, first name, last name, and the number of books written by that author. Sort the output by birth year (ascending).
(vii) Write a query to display the book subject, the average cost of books within that subject, and the difference between the average cost of books within that subject and the average cost of all books. Sort the results by book subject (ascending).
(viii) Write a query to display the book title, the maximum, and the minimum number of days a book is kept during a check out within that title. Sort the results by book title (ascending).
(ix) Write a query to display author ID, the author's first, last name, and the number of subjects for authors who have published books in more than one subject area (book_subject)?
(x) Write a query to display a list of patrons who have checked out at least 3 books. Sort the results by patrons' last name and then the first name?
Intermediate Accounting
ISBN: 978-0470161012
9th Canadian Edition, Volume 2
Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield.