Retrieve the data from a database using subqueries and joins

Assignment Help Database Management System
Reference no: EM13929878

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

Reference no: EM13929878

Questions Cloud

Prepare a detailed design document for the user interface : Prepare a detailed design document for the user interface for your project. Your design document should be based on your Project Requirements and Scope document and your Project Design proposal.
List the drug categories by legal definition : Define the term drug: What is the term for drugs that alter consciousness, thought processes, mood or behavior? List the drug categories by effect. Give examples for each. List the drug categories by legal definition (the text calls it "major types ..
How increasing scrutiny and demand for accountability : Write a one page, double spaced memo to a non-financial audience explaining how increasing scrutiny and demand for accountability by the public has influenced reporting for not-for-profit and governmental entities.
Explain the roles of the various branches of government : Describe the role courts play in determining the nature of federal-state relations. Discuss the recommendations you have to improve or maximize the efficiencies of the federalist representative form of government.
Retrieve the data from a database using subqueries and joins : 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
Write research paper on the nervous system is controversial : Write a Research paper on the nervous system is controversial. In this assignment, you will explore nervous system research and the controversies surrounding it.
Discuss how you will test your design for usability : The Project Design Proposal should outline firstly your design aims for the project and how they will meet the user requirements.
What essential administrative actions that were necessary : Explain why is it that who gets involved in the decision process (and who gets left out) makes such a critical difference in the kind and quality of decisions that are made in government?
Did the police officer make a proper vehicle stop : Did the police officer make a proper vehicle stop? Did the officer act properly in using or threatening force, specifically with regard to restraining the arm of the driver, using pepper spray, and aiming his service revolver at the driver

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd