Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

Using the Northwind Database and SQL Server 2012
prepare SQL statements that will retrieve the following data from a database, using Subqueries and Joins. Using the Northwind database, prepare a SQL SELECT statement that will retrieve the data for the following problems:

1. For each order, display the Company Name, City, and the Country for the customer who placed the order.
Include the Order Date and the Required Date. Order the results by Company Name in ascending order.
830 rows returned.
2. For each order, list the OrderID, Orderdate, Product Name, UnitPrice, Quantity Ordered, and Total Cost. Label the column 'Product Cost.'
For each product (including the discount), only show those orders that were placed in March of 1997.
Sort the data by the OrderID, then the Product Name.
77 rows returned.
3. For each order, display the OrderID, ShipName, and the Employee First and Last Name.
Order the results by Employee Last Name in descending order, then by Employee First Name in ascending Order, then by OrderID in ascending order.
830 rows returned.
4. Modify the first query to list the orders with customer details, but include all customers even if they have not placed an order.
832 rows returned.
5. List all customers (include CustomerId and Company Name) who have placed less than 5 orders.
Include those customers who have placed 0 orders. Name the count field "OrderCount."
Order by number of placed orders in reverse order.
18 rows returned.
6. Display the ProductName, and UnitPrice of all products that have a unit price larger than Tarte au Sucre.
Order the results by UnitPrice in descending order.
7 rows returned.
7. Display the Customer Name of all customers who have placed orders in 1996.
Order the results by Company Name in ascending order.
67 rows returned.
8. Display the OrderID of all orders that where placed after all orders placed by Bottom-Dollar Markets.
Order the result by OrderID in ascending order.
28 rows returned.
9. List the Company Name of all U.S.-based customers who are NOT located in the same state (or region) as any of the employees.
Order the results by Company Name.
10 rows returned.
10. Display the Product Names of all products that were placed by customers in CA.
Order the result by Product Name in ascending order.
Eliminate duplicate rows in the results.
10 Rows Returned.  

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M978950

Have any Question?


Related Questions in PL-SQL

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As