Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide the SQL statement and the number of records returned Using the Northwind Database, please provide the following information. List all fields and all

Please provide the SQL statement and the number of records returned

Using the Northwind Database, please provide the following information.

  1. List all fields and all customer records.
  2. List all fields and customers from London
  3. List all fields of suppliers from London
  4. List of all the product names and quantity/unit (just display product names and quantity)
  5. List of the current (not discontinued) products (just display Product ID and Product name). Hint: To be current, the field discontinued should be 0.
  6. List all of the discontinued products (just display Product ID and Product name).

Hint: To be current, the field discontinued should be 1.

  1. List all employees Last names that placed an order (do not repeat the last name)
  2. List all employees first name and last name in order of their hiring date. First record should be the longest tenured employee. (only list first and last name)
  3. List all employees first and last name, customers first and last name, and the shipping date of an order (only if the customer placed an order).
  4. List the orders for any customer that has a last name starting with the letter F. All I want is order number.
  5. List of employees who processed the order chai. All I want is the employee first and last name.
  6. List the suppliers that have discontinued products. All I want is company name and the product name.

image text in transcribed

Nullable Le No Nullable Yes No Yes No Products Column Name Condensed Type Nulla... 8 ProductID int No Product Name nvarchar(40) No Supplier ID int Yes CategoryID int Yes Quantity PerUnit nvarchar(20) Yes Unit Price money Yes UnitsinStock smallint Yes UnitsOnOrder smallint Yes Reorderlevel smallint Yes Discontinued bit Customers Column Name OustomerID Company Name ContactName Contact Title Address Yes No Yes Yes Yes Yes Orders Column Name Condensed Type 9 OrderID int Customeria nchar(5) EmployeeID int Order Date datetime Required Date datetime Shipped Date datetime Ship Via int Freight money ShipName nvarchar(40) ShipAddress nvarchar(60) ShipCity nvarchar(15) ShipRegion nvarchar(15) ShipPostal Code nvarchar(10) Ship Country nvarchar(15) Yes Condensed ... Nul... nchar(5) No nvarchar(40) No nvarchar(30) Yes nvarchar(30) Yes nvarchar(60) Yes nvarchar(15) Yes nvarchar(15) nvarchar(10) Yes nvarchar(15) Yes nvarchar(24) Yes nvarchar(24) Yes Yes Yes Yes Yes Yes Employees Column Name Condensed Type 7 EmployeeID int LastName nvarchar(20) FirstName nvarchar(10) Title nvarchar(30) TitleOfCourtesy nvarchar(25) Birth Date datetime HireDate datetime Address nvarchar(60) City nvarchar(15) Region nvarchar(15) Postal Code nvarchar(10) Country nvarchar(15) Home Phone nvarchar(24) Extension nvarchar(4) Photo image Notes ntext Reports to int Photo Path nvarchar(255) Yes City Region Postal Code Country Phone No Yes Yes Yes Yes Yes Yes Fax Yes Yes Yes Yes Yes Yes Nullable Yes No Yes No Yes CustomerCustomerDemo Column Name Condens... Nullable 8 CustomerID nchar(5) No 7 CustomerType... nchar(10) No Yes Yes Condensed Type Nullable Yes Suppliers Column Name Condensed Type 7 SupplierID int Company Name nvarchar(40) ContactName nvarchar(30) Contact Title nvarchar(30) Address nvarchar(60) City nvarchar(15) Region nvarchar(15) Postal Code nvarchar(10) Country nvarchar(15) Phone nvarchar(24) Fax nvarchar(24) HomePage ntext int No Yes Order Details Column Name 8 OrderID 9 ProductID Unit Price Quantity int No Yes No Yes money smallint No Employee Territories Column Name Condensed ... N... 8 EmployeeID int No 7 TerritoryID nvarchar(20) No Yes Yes Discount real No CustomerDemographics Column Name Condens... Nul... 8 CustomerTypeID nchar(10) No Customer Desc ntext Yes Yes Yes Nullable No Categories Column Name Condensed Type 7 CategoryID int CategoryName nvarchar(15) Description ntext Picture image Territories Column Name Condensed ... N... 8 TerritoryID nvarchar(20) No Territory Descript... nchar(50) No RegionID int No No Shippers Column Name Condensed... Null... 8 ShipperID int No Company Name nvarchar(40) No Phone nvarchar(24) Yes Yes Region Column Name 8 RegionID Region Description Null... Yes Condens... int nchar(50) No No Nullable Le No Nullable Yes No Yes No Products Column Name Condensed Type Nulla... 8 ProductID int No Product Name nvarchar(40) No Supplier ID int Yes CategoryID int Yes Quantity PerUnit nvarchar(20) Yes Unit Price money Yes UnitsinStock smallint Yes UnitsOnOrder smallint Yes Reorderlevel smallint Yes Discontinued bit Customers Column Name OustomerID Company Name ContactName Contact Title Address Yes No Yes Yes Yes Yes Orders Column Name Condensed Type 9 OrderID int Customeria nchar(5) EmployeeID int Order Date datetime Required Date datetime Shipped Date datetime Ship Via int Freight money ShipName nvarchar(40) ShipAddress nvarchar(60) ShipCity nvarchar(15) ShipRegion nvarchar(15) ShipPostal Code nvarchar(10) Ship Country nvarchar(15) Yes Condensed ... Nul... nchar(5) No nvarchar(40) No nvarchar(30) Yes nvarchar(30) Yes nvarchar(60) Yes nvarchar(15) Yes nvarchar(15) nvarchar(10) Yes nvarchar(15) Yes nvarchar(24) Yes nvarchar(24) Yes Yes Yes Yes Yes Yes Employees Column Name Condensed Type 7 EmployeeID int LastName nvarchar(20) FirstName nvarchar(10) Title nvarchar(30) TitleOfCourtesy nvarchar(25) Birth Date datetime HireDate datetime Address nvarchar(60) City nvarchar(15) Region nvarchar(15) Postal Code nvarchar(10) Country nvarchar(15) Home Phone nvarchar(24) Extension nvarchar(4) Photo image Notes ntext Reports to int Photo Path nvarchar(255) Yes City Region Postal Code Country Phone No Yes Yes Yes Yes Yes Yes Fax Yes Yes Yes Yes Yes Yes Nullable Yes No Yes No Yes CustomerCustomerDemo Column Name Condens... Nullable 8 CustomerID nchar(5) No 7 CustomerType... nchar(10) No Yes Yes Condensed Type Nullable Yes Suppliers Column Name Condensed Type 7 SupplierID int Company Name nvarchar(40) ContactName nvarchar(30) Contact Title nvarchar(30) Address nvarchar(60) City nvarchar(15) Region nvarchar(15) Postal Code nvarchar(10) Country nvarchar(15) Phone nvarchar(24) Fax nvarchar(24) HomePage ntext int No Yes Order Details Column Name 8 OrderID 9 ProductID Unit Price Quantity int No Yes No Yes money smallint No Employee Territories Column Name Condensed ... N... 8 EmployeeID int No 7 TerritoryID nvarchar(20) No Yes Yes Discount real No CustomerDemographics Column Name Condens... Nul... 8 CustomerTypeID nchar(10) No Customer Desc ntext Yes Yes Yes Nullable No Categories Column Name Condensed Type 7 CategoryID int CategoryName nvarchar(15) Description ntext Picture image Territories Column Name Condensed ... N... 8 TerritoryID nvarchar(20) No Territory Descript... nchar(50) No RegionID int No No Shippers Column Name Condensed... Null... 8 ShipperID int No Company Name nvarchar(40) No Phone nvarchar(24) Yes Yes Region Column Name 8 RegionID Region Description Null... Yes Condens... int nchar(50) No No

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

ISBN: 1583473858, 978-1583473856

Students also viewed these Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago

Question

12-5 How will MIS help my career?

Answered: 1 week ago