Question

In mySQL Northwind data base. How many of Northwind's customers, that don't work in sales, are...

In mySQL Northwind data base.

How many of Northwind's customers, that don't work in sales, are explicitly identified as "Manager" in their job title? Please use a subquery.

What is the total order price for each order listed in Northwind's database?

Add to the previous query. Include the Customer ID and Shipping Name for each order that is totaled in the previous query. Sort the output by Customer ID.

Add to the previous query. Include the Title of Courtesy, First Name, and Last Name of the Northwind employee responsible for each sale. Sort the output by the responsible employee's last name.
Edit the query so the responsible employee's information appears in one single column in the output. Results must still be sorted by the employee's last name.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 2:

SQL Query :

select Orders.orderID, sum(UnitPrice*Quantity) 'Total Order Price'
from orders,[order Details]
where
orders.orderid=[order Details].orderID
group by Orders.orderID;

Screen in SQL Server :

select Orders.orderID, sum(UnitPrice Quantity) Total Order Price from orders, [order Details] where orders.orderid=[order D

*****************************************

Question 3:

SQL Query :

select Orders.orderID,CustomerID,ShipName, sum(UnitPrice*Quantity)
'Total Order Price'
from orders,[order Details]
where
orders.orderid=[order Details].orderID
group by Orders.orderID,CustomerID,ShipName
order by CustomerID;

Screen in SQL Server :

select Orders.orderID, CustomerID, ShipName, sum(UnitPriceQuantity) Total Order Price from orders, [order Details] where or

*****************************************

Question 4:

SQL Query :

select Orders.orderID,CustomerID,ShipName,TitleOfCourtesy,FirstName,LastName,
sum(UnitPrice*Quantity) 'Total Order Price'
from Employees,orders,[order Details]
where
Employees.EmployeeID=Orders.EmployeeID and
orders.orderid=[order Details].orderID
group by Orders.orderID,CustomerID,ShipName,TitleOfCourtesy,FirstName,LastName
order by LastName;

Screen in SQL Server :

select Orders.orderID, CustomerID, ShipName, TitleOfCourtesy, FirstName, LastName, sum (UnitPrice Quantity) Total Order Pric

*****************************************

Question 5:

SQL Query :

select Orders.orderID,CustomerID,ShipName,TitleOfCourtesy+'.'+FirstName+''+LastName as 'Employee',
sum(UnitPrice*Quantity) 'Total Order Price'
from Employees,orders,[order Details]
where
Employees.EmployeeID=Orders.EmployeeID and
orders.orderid=[order Details].orderID
group by Orders.orderID,CustomerID,ShipName,TitleOfCourtesy,FirstName,LastName
order by LastName;

Screen in SQL Server :

select Orders.orderID, CustomerID, ShipName, TitleOfCourtesy+.+FirstName++LastName as Employee, sum (UnitPrice Quantity

*****************************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
In mySQL Northwind data base. How many of Northwind's customers, that don't work in sales, are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display...

    Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title ends in the word “ASSOCIATE.” Sort the output by department name and employee title Problem 36, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the number of products within each base and type combination, sorted by base and then by type...

  • The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind...

    The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. Here is the schema of the database: Products (ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued); Suppliers (SupplierID, CompanyName, ContactName , ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage); Categories (CategoryID, CategoryName, Description, Picture); Orders (OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia,  Freight, ShipName,ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry); Order_details (ID, OrderID,...

  • Need MySql commands for Use a UNION statement. Display the address ID, address, and district from...

    Need MySql commands for Use a UNION statement. Display the address ID, address, and district from the address table where the district is California or Alberta. Display the address ID, address, and district only from the address table where the address contains Jol. Display the language ID and name from the language table and the film ID from the film table. Display all languages whether they have an associated film or not. Order results by language ID in ascending order....

  • Use the Northwind and Hospital data models diagrams to answer the following questions 1.) HOSPITAL: Write...

    Use the Northwind and Hospital data models diagrams to answer the following questions 1.) HOSPITAL: Write a query to list the name and assignment History for employee #12345. The assigmnet history is to include the department name and also the number of months the employee served in that assignment. (Do not worry about the fact that this cannot be calculated for the current assignment, at least with what we know now). For one bonus point describe what logic might allow...

  • Can you please write the MySQL Query sentences for the following items below? For example: SELECT...

    Can you please write the MySQL Query sentences for the following items below? For example: SELECT * FROM employees; Generate a list of salespeople sorted descending by hire date. Show the ID, first name, last name, hire date, and salary for each salesperson. Generate a list of customers whose last name begins with the letter “M.” Show the first and last names of these customers. Sort the list of customers descending by last name. C. Generate a list of customers...

  • Questions are based on the Northwind database. a. A data dictionary (Excel file) that describes each...

    Questions are based on the Northwind database. a. A data dictionary (Excel file) that describes each of the tables. (Attached in question) b.    Write good, clean SQL that answers the following questions. c.     Separate your queries as I have done in the following example. End each query with a semicolon (;) and insert the word "go" between each query. Queries can span multiple lines if required. Select CustomerID from Customers; go Select Count(*) from Employees; go Select max(productID) from Products; 18. Produce...

  • Sample data is provided for the database for the sales system. Using the sample data, you...

    Sample data is provided for the database for the sales system. Using the sample data, you will determine the entities, key components of the entities, and business rules for the entities. Using the entities and business rules you will then create an ERD. Tasks: 1. For each entity provide the name, description, fields, data type, primary key, and foreign key. 2. For each direct entity type pair, provide the business rules. 3. Provide the ERD. Customer Table Customer ID, Last...

  • This is a website picture The html and css code is as follow And my problem is as follow use the php and mysql Northwind Customer Database Search List Records All Records CustomerName v CustomerName...

    This is a website picture The html and css code is as follow And my problem is as follow use the php and mysql Northwind Customer Database Search List Records All Records CustomerName v CustomerName ContactName Address City PostalCode Search O ASC DESC List All Records Insert Record Country List City CustomerName ContactName Address City PostalCode Country List City Find by IID Find Insert 1 <! DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http:L 3-<head> 4 Kmeta http-equiv-"Content-Type" content-"text/html; charset-utf-8" />...

  • I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental...

    I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental ID, Rental date, customer ID, customer first name, customer last name, and count of disks rented; sort by Rental ID. Show the Rental date formatted as ‘mm-dd-yyyy.’ Hint: use a GROUP BY clause. 19. 4 points List the disk ID, title name, rating, format description, and fee amount for all copies rented in Rental 3; sort by disk ID. Show the fee amount formatted...

  • I am using MySQL and the answers I've found previously on this site did not work....

    I am using MySQL and the answers I've found previously on this site did not work. List the customer number for each customer in the CUSTOMERS table, along with the city and state in which the customer lives. Answer: Create a list containing the publisher’s name, the person usually contacted, and the publisher’s telephone number. Rename the contact column “Contact Person” in the displayed results. (Hint: Use the PUBLISHERS table.)             Answer: List the customer number from the ORDERS table for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT