Using the Northwind Database write the SQL for all of these and execute them. Do
ID: 3594019 • Letter: U
Question
Using the Northwind Database write the SQL for all of these and execute them. Do NOT use the MS Access Query By Example (QBE) feature. Actually write the SQL.
1.Using the ‘SUM’ function with the Group By clause, what is the query that will display a total quantity ordered from each supplier?
2.What is the query that meets the following specifications:
a.‘JOIN’s the Product and Category tables
b.Displays from the Product Table: ProductID, ProductName, CategoryID
c.Displays from the Category Table: CategoryName
d.Only include rows that are for Dairy Products or Beverages.
Explanation / Answer
1.
Select Supplier.CompanyName, SUM(Quantity) from Order_Detail inner join Product on Order_detail.ProductID = Product.ProductID inner join Supplier on Product.SupplierID = Supplier.SupplierID group by Supplier.SupplierID;
2.
Select Product.ProductID,Product.ProductName,Product.CategoryID ,Category.CategoryName from Product inner join Category on Product.CategoryId = Catgory.CategoryID where Product.ProductName LIKE '%Dairy%' or Product.ProductName LIKE '%Beverges%' ;
a. Product inner join Category on Product.CategoryId = Catgory.CategoryID
b. Select Product.ProductID,Product.ProductName,Product.CategoryID
c. ,Category.CategoryName
d. where Product.ProductName LIKE '%Dairy%' or Product.ProductName LIKE '%Beverges%'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.