SQL

QUIZ

Please review provided ERD for Sales in ****database.

Only Assumptions :

Total order quantity is: sum(quantityOrdered ) as Qty,

TotalAmount is: sum(priceEach*quantityOrdered) as total

construct SQL statement joining all necessary tables, RUN it and choose correct result.

EXAMPLE of possible sql to find TotalAmount for officeCode = 1 :

select sum(od.priceEach * od.quantityOrdered) as total , of.officeCode

from yhelen.orders o join yhelen.orderdetails od on o.orderNumber = od.orderNumber 

join yhelen.products p on p.productCode = od.productCode join 

yhelen.customers c on c.customerNumber = o.customerNumber join

 yhelen.employees e on e.employeeNumber = c.salesRepEmployeeNumber join

 yhelen.offices of on of.officeCode = e.officeCode 

group by 2

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)