3) Write a query to show the number of orders for each shipper. Your query shoul
ID: 3799799 • Letter: 3
Question
3) Write a query to show the number of orders for each shipper. Your query should show shipper name and the count of orders with the shipper.
4) Write a query to show number of products in each product category. Your query should show Category name and number of products in that category.
5) Write a query that shows Customers’ country wise customer count, and order count. Your query should show country name, total number of customers from that country, and total number of orders from the customers of that country.
6) Write a query that shows the number of products supplied by each Supplier. Your query should show Country name, supplier name and the count of products supplied by that supplier.
3) Write a query to show the number of orders for each shipper. Your query should show shipper name and the count of orders with the shipper. 4) Write a query to show number of products in each product category. Your query should show Category name and number of products in that category. 5) Write a query that shows Customers' country wise customer count, and order count. Your query should show country name, total number of customers from that country, and total number of orders from the customers of that country. 6) write a query that shows the number of products supplied by each Supplier. Your query should show Country name, supplier name and the count of products supplied by that supplier Note: Sale Price Orderdetails.Quantity Products.price (see an example in the class slides deck) W3SCHOOLS SQL is located at http://www.w3schools.com/sql/default.asp (Preferred browser is Chrome). On this page you will find a button called "Try it yourself". Click on that button. You will be redirected to a page where you see a list of tables on the right side of the page. It is highly recommended to click 'Restore Database' button on this page during every session. The page contains a box where you can type in an SQL statement involving the listed tables. You type in your SQL statement in that box and click on "Run SQL" button. The results will be displayed if your SQL statement is syntactically correctExplanation / Answer
3) SELECT Shippers.ShipperName,COUNT(Orders.OrderID) AS NumberOfOrders FROM Orders
LEFT JOIN Shippers
ON Orders.ShipperID=Shippers.ShipperID
GROUP BY ShipperName;
4) Assumption- Categorys Table exist with CategoryID & Name
SELECT Categorys.CategoryName, count(Products.ProductID) AS NumberOfProducts FROM Products
JOIN Categorys
ON Categorys.CategoryID = Products.CategoryID
GROUP BY CategoryID;2) Assumption- Categorys Table exist with CategoryID & Name
SELECT Categorys.CategoryName, count(Products.ProductID) AS NumberOfProducts FROM Products
JOIN Categorys
ON Categorys.CategoryID = Products.CategoryID
GROUP BY CategoryID;
5) SELECT Customers.Country, count(Customers.CustomerID) AS NumberOfCustomers, count(Orders.OrderID) AS TotalNumbersOfOrder FROM Customers
JOIN Orders
ON Customers.CustomerID = Orders.CustomerID
Group BY Customers.Country;
6) SELECT Suppliers.Country, Suppliers.SupplierName, Count(Products.ProductID)
FROM Suppliers
JOIN Products ON Suppliers.SupplierID = Products.SupplierID
JOIN OrderDetails ON OrderDetails.ProductID = Products.ProductID
Group By Suppliers.SupplierID;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.