Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN SQL SCHEMA Provide a list of book categories containing more book titlesthan those in the COOKING category. Include the category nameand the number of
IN SQL SCHEMA
- Provide a list of book categories containing more book titlesthan those in the COOKING category. Include the category nameand the number of books within the category in your output. You must use a subquery to determine how many books in the COOKINGcategory.
- Provide a list of books showing each book?s title, category,and cost. Limit your output to only those books with a costequal to or greater than the average cost of all books in thefollowing categories: CHILDREN, LITERATURE, and FITNESS. YouMUST use a multiple-column subquery to determine the average bookcost.
- We are interested in knowing which books customer 1007 might beinterested in purchasing in the future. Produce a list ofbook titles for all categories in which customer 1007 has purchasedpreviously. Be sure that no books already purchased bycustomer 1007 are included in your list. Hint: this onerequires two subqueries.
- Count the number of orders placed for each book. Limityour list to only those books with a retail price greater than theaverage retail price of all books. Include only the ISBN andorder count in your output. Sort your output in ascendingorder by ISBN. Use nested subqueries. The innermostsubquery should find the average retail price. Anothersubquery should use this average to identify ISBNs with theappropriate retail price. Finally, an outer query will countthe number of orders for each ISBN in that list.
ACCTMANAGER AUTHOR BOOKAUTHOR BOOKS ISBN TITLE PUBDATE PUBID COST RETAIL DISCOUNT CATEGORY BOOKS_1 BOOKS_2 CATERING EVENTS CONTACTS CUSTOMERS DEPARTMENT EMPLOYEES ORDERITEMS ORDERS PROMOTION PUBLISHER PUBLISHER2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
1Query One Solution select CATEGORYcount as Number of Books from BOOKS group by CATEGORY having coun...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