Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write and execute SQL for the following. Use the Northwind sample database. Include the SQL for each problem in your results submitted to your inetructor.

image text in transcribed

Write and execute SQL for the following. Use the Northwind sample database. Include the SQL for each problem in your results submitted to your inetructor. Do NOIee the MS Access Query By Example (QBE) feature. Actually wre the SOL 1. Using the GROUP BY clause and the COUNT function, create a query that will give 5. Create a query that will 'join' the Products, Categories, and Suppliers tables, and from the Products Table from the Categories Table produce a result set with the following columns: ProductD CategoryName from the Suppliers Table a count ofall the Products, from the Products table, for each Category, In your result set, display the category ID as ell as the count. Country Only include Products from Suppliers in Germany and France. SELECT P ProductlD,C.CategoryName,S.Country FROM Products P, Categories C, Suppliers S WHERE Country-Germany OR Country France' select CategoryId, count) from products GROUP BY Categoryld; a query that will 'join' the Products and result set with the following columns: from the Products Table from the Products Table from the Products Table Create a query that will join' the Products, Categories, and Suppliers tables, and produce a result set with the following columns: 6. CategoryName from the Categories Table ProductiD ProductName CategoryID SupplierlD from the Produc Table from the Products Table from the Categories Table from the Suppliers Table from the Products Table UnitPrice Only include Category Names of. Beverages, and Produce select P.ProductID, P.ProductName, P.CategoryId, C.CategoryName, P.UnitPrice from Products P, Categories C where P.CategoryId- C.Categoryld and C.CategoryName in "Beverages", "Produce"); Only include Product names that start with the letter G SELECT P ProductlD, P ProductName, P.Categoryld, P.Supplierld FROM Products P, Categories C, Suppliers S WHERE ProductName LIKE'G 3- Create a query that will "join' the Products and Suppliers tables, and produce a result set with the following columns: 7. Create a query that will join' the Products, Categories, and Suppliers tables, and produce a result set with the following columns: from the Products Table from the Products Table from the Products Table CompanyName from the Suppliers Table ContactNamefrom the Suppliers Table from the Suppliers Table ProductiID CategoryID Country from the Products Table from the Categories Table from the Suppliers Table ContactTitle Only include Products from Suppliers in London. Only include Supplier ID 1-4, in your result SELECT P.ProductD, C.CategoryId, S.Country FROM Products P, Categories C, Suppliers S WHERE S.Country London select P.ProductID, P.ProductName, P.Supplierld, S.CompanyName, S.ContactName, S.ContactTitle from Products P, Suppliers S where P.Supplierld- S.Supplierld and P.Supplierld between 1 and 4; 8. Create a query that will join' the Products, Categories, and Suppliers tables, and produce a result set with the following columns e a query that will "join" the Products. produce aresult set with the following columns: and tables, and from the Products Table from the Categories Table from the Suppliers Table CategoryIID from the Products Table from the Products Table Country Only include Products from Suppliers whose Company Name Begins with the letter L CategoryName from the Categories Table SELECT P.ProductlD, C.CategoryId, S.Country FROM Products P, Categories C, Suppliers S WHERE companyName LIKE 'L CompanyName from the Suppliers Table Only include Categories: 1,4, and 7, in your result SELECT P.ProductID, P ProductName, C.CategoryName, S.CompanyName FROM Products P, Suppliers S, Categories C WHERE P.Supplierld- S.Supplierld and P CategoryId C.Categoryld and P. Categoryld in (1,4,7)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago