Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You must use the Access database and create queries that will answer the request

ID: 3725574 • Letter: Y

Question

You must use the Access database and create queries that will answer the requests below.
You may use direct SQL to create the queries. Store them using the number of the question (Q1, Q2, etc.).

Question: Obtain the average price before discount of all books that were delivered after May 5, 2016.

We're not using Join or Join In functions. Just SELECT, FROM, WHERE, ORDER BY, and SORT BY Thanks!

Book Wrote Author Authorid AuthornD FrstName nitials Category AuthorRank OrderLine Order Customer OrderNo OrderRank ISEN CustomerName CustomerAddress Stato OrderDeliveryCate Quanbty PercentageOiscount

Explanation / Answer

Below is the query. Since the average is given of the price before the discount, we dont need to use the PercentageDiscount colum, directly get the price from the Price column. We are using nested queries here. We are using average function also.

-> first the most inner query will run, then the query encapsulating it.
-> first all the orders after May 5 2016 are taken.
-> then the ISIN of all these orders are taken.
-> then this ISIN are used to get all the records from the book table.
-> then the average of prices of all the books are calculated.

select avg(Price) from book where ISIN in

(select ISIN from OrderLine where OrderNo in

(select OrderNo from Order where OrderDate > '05/05/2006'));

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote