Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

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.

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.

- 5 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.

- 67 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

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91602753
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in DBMS

In this section the student is required to develop a

In this section, the student is required to develop a technical debate based on his/her understanding using available scientific literature. The answer to this question should not exceed three A4 Pages. In the traditiona ...

Solve the following questions using oracle you are not

Solve the following questions using Oracle. You are not allowed to use the syntax of any DBMS other than Oracle. Make sure to upload an electronic copy of your solution to your CSC335 TRACE folder. Name the file hw4.sql. ...

You are in a real estate business renting apartments to

You are in a real estate business renting apartments to customers. Your job is to define an appropriate schema using SQL DDL in MySQL. The relations are Property(Id, Address, NumberOfUnits), Unit(ApartmentNumber, Propert ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

Real time analytics - data analytics assignment -this is a

Real Time Analytics - Data Analytics Assignment - This is a business analytics project aimed at generating innovative analytics solutions for a Global Food Consulting firm working in the area of Animal agriculture and fa ...

Tableau is business intelligence software that helps people

Tableau is business intelligence software that helps people see and understand their data. Fast Analytics Connect and visualize your data in minutes. Tableau is 10 to 100x faster than existing solutions. Ease of Use Anyo ...

In sql database questions phase-1 in 100 words what steps

In SQL Database Questions: Phase-1 In 100 words, what steps can one take to avoid losing work? Which command is used to save changes to the database? What is the syntax for this command? Phase-2 In 100 words, explain the ...

Select from e d pwhere edeptddept and dcitypcity and

Select * From E, D, P WHERE E.dept=D.dept AND D.city=P.city AND D.budget>1M AND P.priority=A; Assuming relations have the same size and uniform distributions, what is the best plan with Nested Loop joins only? Write it a ...

Students will select a situation or problem from their

Students will select a situation or problem from their company as a course project that can be solved using a database system. Using MS Access, or MS SQL Server Express, students will create a relational database model o ...

  • 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