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

  Unified modeling language

Select at least two business systems (such as email and billing) and create a Unified Modeling Language in the form of a sequence diagram showing how they can be integrated. Use Visio or any other standard diagramming that has UML templates. Expor..

  Draw an erd

Draw an ERD for the following problem with attributes, primary keys, cardinalities and participation constraints and specialization, if appropriate

  Design data file grades with records of form

Input names of students from user, terminated by ZZZ, and design the data file GRADES with records of form: student (string), test1 (integer), test2 (integer), test3 (integer).

  Describe the entities of the database

Based on your research and / or common knowledge of a college and the information tracked by a college, describe the entities of the database and the attributes of each entity

  Write problems and issues associated with internet databases

Over 70% of web applications use database to store persistent data. Write some of the problems and issues associated with internet databases?

  Identify a relational algebra tree

Identify a relational algebra tree (or a relational algebra expression if you prefer) that reflects the order of operations a decent query optimizer would choose.

  List all pair of products names which are in same city

List the names of agents that placed an order for customer C003 or customer C006. List all pair of products names that are in the same city, along with their city name.

  Measurement of two lengths in feet and inches

"create a form with textboxes to enter the measurement of two lengths in feet and inches as integer values and compute the total length in feet and inches. For example, the total length of 5 feet 8 inches and 4 feet 6 inches is 10 feet 2 inches; a..

  Use r to calculate following probability from z distribution

Use R to calculate the following probability from Z distribution

  Convert data model to a set of virtual windows

You are to design a prototype for a hospital management system. Design a data model for this system, Convert the data model to a set of virtual windows.

  Write sql queries to solve the given specifications

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT. A screen dump of the output is acceptable. Show as many rows as you can.

  Creating a database and then adding to it a foreign key

creating a database and then adding to it a foreign key constraint

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