Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Problem:

Write SQL statements that will retrieve the following data from a database, using Subqueries and Joins. Using the Northwind database, write a SQL SELECT statement that will retrieve the data for the following questions:

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.

Additional Information:

The question is from Computer Science and it explains about writing SQL queries for retrieving data in TSQL.

Total Word Limit: 338 Words

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91399212
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Suppose two nodes a and b are attached to opposite ends of

Suppose two nodes, A and B, are attached to opposite ends of an 800 m cable, and that they each have one frame of 1, 500 bits (including all headers and preambles) to send to each other. Both nodes attempt to transmit at ...

A cell phone company offers 15 different voice packages and

A cell phone company offers 15 different voice packages and 15 different data packages. Of those, 6 packages include both voice and data. How many ways are there to choose either voice or data, but not both?

A decision maker has ordered every commodity in walmart

A decision maker has ordered every commodity in Walmart alphabetically according to the commodity's name. Every time when he needs to choose from several commodities, he always choose the second one according to his orde ...

Question you recently have been hired as the director of

Question: You recently have been hired as the Director of Systems Administration operations for ViralMedia, a provider of software tools for graphics artists. The company's core product, DigiWorld, runs under Windows and ...

A survey of 200 students is selected randomly on a large

A survey of 200 students is selected randomly on a large university campus. They are asked if they use a laptop in class to take notes. The results of the survey is that 70 of the 200 students responded yes. Calculate th ...

Discuss the importance of metadata and some of the various

Discuss the importance of metadata and some of the various ways (Microsoft) SQL Server allows you to expose that information. References welcomed to learn where to find obscure IT information (books, articles, websites)

Quesiton your final research paper assignment is to write a

Quesiton: Your final research paper assignment is to write a research paper that explains how defense-in-depth (chapter 6) and awareness (chapter 10) are complimentary techniques to detect emerging threats and strengthen ...

Can someone please code this simple background subtraction

can someone please code this simple background subtraction but with height and width ratio to detect a human being. Please! I so badly need it for my dissertation,, cant make a loop that would subtract the every frame fr ...

String firstnamearraychar gradearrayassuming that this text

String firstName[ARRAY]; char grade[ARRAY]; Assuming that this text file is already inputted into the program. Write a loop that will display the students that have "A" or "B" next to their names. If the stuent has a "A" ...

1 write code in the method linearsearch in

1. Write code in the method linearSearch() in "SearchMethods"class which finds the element in an array using linear search approach and returns its index to the calling main method, otherwise it returns -1. 2. Write code ...

  • 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