Review all tables and use correct column names. Total order quantity is:sum(quantityOrdered ) as Qty, TotalAmount
Fantastic news! We've Found the answer you've been seeking!
Question:
Review all tables and use correct column names.
Total order quantityis:sum(quantityOrdered ) as Qty,
TotalAmountis: sum(priceEach*quantityOrdered) as total
To answer a question please construct SQL statement joining all necessary tables, RUN it and choose correct result.
EXAMPLEof possible sql to find TotalAmount for officeCode = 1 :
use FinalSQL; select sum(od.priceEach * od.quantityOrdered) as total , of.officeCode from orders o join orderdetails od on o.orderNumber = od.orderNumber join products p on p.productCode = od.productCode join customers c on c.customerNumber = o.customerNumber join employees e on e.employeeNumber = c.salesRepEmployeeNumber join offices of on of.officeCode = e.officeCode group by 2;
Related Book For
Posted Date: