Part 2 Using WideWorldImporters database and the Sales schema write query that returns the CustomerID from the Customers
Posted: Fri May 20, 2022 3:40 pm
Part 2 Using WideWorldImporters database and the Sales schema
write query that returns the CustomerID from the Customers table,
the OrderID from the Orders table, and the total of all orders
(UnitPrice times Quantity) from the OrderLines table. Take a screen
shot of the SQL windows and results and paste it here.
Part 3 Rewrite the query in Part 2, returning the CustomerName
and OrderDate instead of the CustomerID and OrderID, the sales
total for each order, and the total of all orders for the
CustomerName, OrderDate, and order total. Do not use Group By. Take
a screen shot of the SQL windows and results and paste it
here..
The previous answer does NOT work.
Part 2: select CI.CustomerID,OI.OrderID, sum(OL.UnitPrice) from Customers CI join Orders Ol on Cl.(CommonColumnName)=Ol.CommonColumnName) join OrderLines OL on Ol.(CommonColumnName)=OL.(CommonColumnName) Part 3: select CI.CustomerName, Ol.Order Date,sum((Alias of table which contain sales Column).Sales), sum(CI.CustomerName), sum(Ol.orderDate) from Customers CI join Orders Ol on Cl.(CommonColumnName)=01.(CommonColumnName) join OrderLines OL on Ol.(CommonColumnName)=OL.(CommonColumnName)
write query that returns the CustomerID from the Customers table,
the OrderID from the Orders table, and the total of all orders
(UnitPrice times Quantity) from the OrderLines table. Take a screen
shot of the SQL windows and results and paste it here.
Part 3 Rewrite the query in Part 2, returning the CustomerName
and OrderDate instead of the CustomerID and OrderID, the sales
total for each order, and the total of all orders for the
CustomerName, OrderDate, and order total. Do not use Group By. Take
a screen shot of the SQL windows and results and paste it
here..
The previous answer does NOT work.
Part 2: select CI.CustomerID,OI.OrderID, sum(OL.UnitPrice) from Customers CI join Orders Ol on Cl.(CommonColumnName)=Ol.CommonColumnName) join OrderLines OL on Ol.(CommonColumnName)=OL.(CommonColumnName) Part 3: select CI.CustomerName, Ol.Order Date,sum((Alias of table which contain sales Column).Sales), sum(CI.CustomerName), sum(Ol.orderDate) from Customers CI join Orders Ol on Cl.(CommonColumnName)=01.(CommonColumnName) join OrderLines OL on Ol.(CommonColumnName)=OL.(CommonColumnName)