Need help solving this script from NorthWind database
I want to know the total amount of sales in dollars and thetotal cost of shipping for each country. Use the order details andorders tables, compute total sales usingunitprice*quantity-discount )
Solution
Dear Student ,
As per the requirement submitted above , kindly find the belowsolution.
This demonstration is using SQL Server 2014.
SQL Query:
select Shipcountry,Round(sum(unitprice*quantity-discount),2) as’Total Sales’,
round(sum(Freight),2) as ‘Shipping Cost’ from orders,[OrderDetails]
where orders.OrderID=[Order Details].OrderId
group by Shipcountry;
Screen in SQLServer Management Studio (SSMS):
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THESOLUTION.
뜻
OR
OR