Question
* This question has three parts. *Database Diagram is listed below (it's from the NorthwindTablesandData). Part 1. The Nordic region, or Norden, may be defined
*This question has three parts.
*Database Diagram is listed below (it's from the NorthwindTablesandData).
Part 1. The Nordic region, or Norden, may be defined as consisting of the five sovereign states Denmark, Finland, Iceland, Norway and Sweden. Show the number of orders placed by customers from the Nordic region. Display the data with country first, then the number of orders for customers by country. Sort the data by country alphabetically.
the output must look like this:
Part 2. Employees assist with orders. They get a 2% commission on all the orders they help with. Provide a list of employees, the total of orders they assisted on and their 2% commission. Format the total and commission in currency format. Sort the list by employee last name and first name. The expected result with correct column headers is shown below
Part 3. Each row of the Order Details table of the Northwind database represents a single line item for a customer order. There is a single row for each product on a particular order. With this in mind, find the discounted line item values that are greater than or equal to the average discounted line item value across all discounted line items. Show the Discounted Value, OrderID and ProductID of the chosen line items. Sort them ascending by discounted line item value and then by order id, and finally by product id. There are 621 rows in the expected result set. Here are the first 10 rows
>> Database Diagrams are listed below:
Country Number of Orders Denmark 18 Finland 22 Norway 6 Sweden 37 Employee Name Employee Total Employee 2% Commission Buchanan, Steven $528,974.25 $10,579.49 Callahan, Laura $533,204.12 $10,664.08 Davolio, Nancy $404,287.42 $8,085.75 Dodsworth, Anne $580,748.00 $11,614.96 Fuller, Andrew $1,244,244.82 $24,884.90 King, Robert $1,412,959.90 $28,259.20 Leverling, Janet $852,205.20 $17,044.10 Peacock, Margaret $750,562.35 $15,011.25 Suyama, Michael $390,990.50 $7,819.81 Discounted Line Item Value OrderID $588.00 10447 $590.40 10558 $590.75 10330 $591.00 10298 $591.60 11044 $592.80 10564 $592.80 10871 $593.30 10551 $593.75 10584 $593.75 10953 Product ID 65 53 72 62 62 17 17 16 31 31 Condensed Type Allow Nulls Identity int Order Details Column Name Condensed Type Allow Nulls Identity 8 OrderlD int 9 ProductID int UnitPrice money Quantity smallint Discount real nvarchar(40) Categories Column Name Condensed Type Allow Nulls Identity 9 CategoryID int CategoryName nvarchar(15) Description ntext Picture image int 000000 Products Column Name 8 ProductID Product Name SupplierlD CategoryID QuantityPerUnit UnitPrice UnitsinStock UnitsOnOrder ReorderLevel 00000 int nvarchar(20) money smallint smallint smallint 00000000000 8 Identity Discontinued bit Employee Territories Column Name Condensed Type Allow Nulls Identity 9 Employeeld TerritoryID nvarchar(20) int Customers Column Name Condensed Type Allow Nulls 9 CustomerlD nchar(5) CompanyNa... nvarchar(40) Contact Name nvarchar(30) Contact Title nvarchar(30) Address nvarchar(60) M City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) Country nvarchar(15) Phone nvarchar(24) Fax nvarchar(24) OOO |TOO Territories Column Name Condensed Type Allow Nulls Allow Nulls Identity 8 TerritoryID nvarchar(20) TerritoryDescription nchar(50) RegionID int Suppliers Column Name Condensed Type Allow Nulls Identity Suppliers int CompanyName nvarchar(40) ContactName nvarchar(30) Contact Title nvarchar(30) M Address nvarchar(60) City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) Country nvarchar(15) Phone nvarchar(24) M Fax nvarchar(24) HomePage ntext 000 Region Column Name Condensed Type Allow Nulls Identity 9 RegionID int RegionDescription nchar(50) 000 CustomerCustomerDemo Column Name Condensed Type Allow Nulls Identity 9 CustomerlD nchar(5) CustomerTypeID nchar(10) Employees Column Name Condensed Type Allow Nulls Identity Employeeld int LastName nvarchar(20) FirstName nvarchar(10) Title nvarchar(30) TitleOfCourtesy nvarchar(25) BirthDate datetime HireDate datetime Address nvarchar(60) City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) M Country nvarchar(15) HomePhone nvarchar(24) Extension nvarchar(4) Photo image OOOOOOOOOOOOOOOOOOO Orders Column Name Condensed Type Allow Nulls Identity od 9 OrderD int CustomerlD nchar(5) Employeeld int OrderDate datetime RequiredDate datetime ShippedDate datetime ShipVia int Freight money ShipName nvarchar(40) ShipAddress nvarchar(60) Ship City nvarchar(15) Ship Region nvarchar(15) ShipPostalCode nvarchar(10) Ship Country nvarchar(15) D Customer Demographics Column Name Condensed Type Allow Nulls Identity CustomerTypeID nchar(10) CustomerDesc ntext 000 ntext Notes Reports To PhotoPath int nvarchar(255) Shippers Column Name Condensed Type Allow Nulls Identity 8 ShipperID int CompanyName nvarchar(40) Phone nvarchar(24) Country Number of Orders Denmark 18 Finland 22 Norway 6 Sweden 37 Employee Name Employee Total Employee 2% Commission Buchanan, Steven $528,974.25 $10,579.49 Callahan, Laura $533,204.12 $10,664.08 Davolio, Nancy $404,287.42 $8,085.75 Dodsworth, Anne $580,748.00 $11,614.96 Fuller, Andrew $1,244,244.82 $24,884.90 King, Robert $1,412,959.90 $28,259.20 Leverling, Janet $852,205.20 $17,044.10 Peacock, Margaret $750,562.35 $15,011.25 Suyama, Michael $390,990.50 $7,819.81 Discounted Line Item Value OrderID $588.00 10447 $590.40 10558 $590.75 10330 $591.00 10298 $591.60 11044 $592.80 10564 $592.80 10871 $593.30 10551 $593.75 10584 $593.75 10953 Product ID 65 53 72 62 62 17 17 16 31 31 Condensed Type Allow Nulls Identity int Order Details Column Name Condensed Type Allow Nulls Identity 8 OrderlD int 9 ProductID int UnitPrice money Quantity smallint Discount real nvarchar(40) Categories Column Name Condensed Type Allow Nulls Identity 9 CategoryID int CategoryName nvarchar(15) Description ntext Picture image int 000000 Products Column Name 8 ProductID Product Name SupplierlD CategoryID QuantityPerUnit UnitPrice UnitsinStock UnitsOnOrder ReorderLevel 00000 int nvarchar(20) money smallint smallint smallint 00000000000 8 Identity Discontinued bit Employee Territories Column Name Condensed Type Allow Nulls Identity 9 Employeeld TerritoryID nvarchar(20) int Customers Column Name Condensed Type Allow Nulls 9 CustomerlD nchar(5) CompanyNa... nvarchar(40) Contact Name nvarchar(30) Contact Title nvarchar(30) Address nvarchar(60) M City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) Country nvarchar(15) Phone nvarchar(24) Fax nvarchar(24) OOO |TOO Territories Column Name Condensed Type Allow Nulls Allow Nulls Identity 8 TerritoryID nvarchar(20) TerritoryDescription nchar(50) RegionID int Suppliers Column Name Condensed Type Allow Nulls Identity Suppliers int CompanyName nvarchar(40) ContactName nvarchar(30) Contact Title nvarchar(30) M Address nvarchar(60) City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) Country nvarchar(15) Phone nvarchar(24) M Fax nvarchar(24) HomePage ntext 000 Region Column Name Condensed Type Allow Nulls Identity 9 RegionID int RegionDescription nchar(50) 000 CustomerCustomerDemo Column Name Condensed Type Allow Nulls Identity 9 CustomerlD nchar(5) CustomerTypeID nchar(10) Employees Column Name Condensed Type Allow Nulls Identity Employeeld int LastName nvarchar(20) FirstName nvarchar(10) Title nvarchar(30) TitleOfCourtesy nvarchar(25) BirthDate datetime HireDate datetime Address nvarchar(60) City nvarchar(15) Region nvarchar(15) PostalCode nvarchar(10) M Country nvarchar(15) HomePhone nvarchar(24) Extension nvarchar(4) Photo image OOOOOOOOOOOOOOOOOOO Orders Column Name Condensed Type Allow Nulls Identity od 9 OrderD int CustomerlD nchar(5) Employeeld int OrderDate datetime RequiredDate datetime ShippedDate datetime ShipVia int Freight money ShipName nvarchar(40) ShipAddress nvarchar(60) Ship City nvarchar(15) Ship Region nvarchar(15) ShipPostalCode nvarchar(10) Ship Country nvarchar(15) D Customer Demographics Column Name Condensed Type Allow Nulls Identity CustomerTypeID nchar(10) CustomerDesc ntext 000 ntext Notes Reports To PhotoPath int nvarchar(255) Shippers Column Name Condensed Type Allow Nulls Identity 8 ShipperID int CompanyName nvarchar(40) Phone nvarchar(24)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started