How many different customers have ordered products

Assignment Help Basic Computer Science
Reference no: EM13718188

Fully qualify all your field names. Rename and order as appropriate.

For this assignment, you'll have to answer some fairly complex queries. I'm going to ask the question first, then ask sequence of questions to lead you up to the big query. Hopefully, you'll get some practice with how to approach a bigger, more complex query.

How many different customers have ordered products in each category? Two columns, categoryname and count of distinct customers. Make sure to include EVERY category.

  1. Show the CategoryName and ProductName of every product. Order by CategoryName
  2. Copy #1. Show CategoryName, ProductName, and Discount for every product on every order detail. (JOIN in the [Order Details] table)
  3. Copy #2.Show the CategoryName, ProductName, and CustomerID for every Order Detail. (JOIN in the Orders table, and show the CustomerID from the Orders table)
  4. Copy #3. Make this change. In the FROM statement, separate out the JOINs of Products, [Order Details] and Orders from the Categories. So it will look something like this:
FROM        Categories 
INNER JOIN (  Products 
INNER JOIN    [Order Details] ON ...
INNER JOIN    Orders          ON ... 
           )                  ON Categories.CategoryID = Products.CategoryID
  1. Copy #4. Now make sure that EVERY Category is shown, even those that don't match up with a Product/Order. (Just change one of te INNER JOINs to a LEFT JOIN. You should see some NULLs appear in ProductName, Discount,etc.)
  2. Copy #5. Show the CategoryName, and the count of the number of CustomerIDs.
  3. Copy #6. Show the CategoryName, and the DISTINCT count of the number of CustomerIDs. (This answers the original question)

Give a count of orders by sales region and category for the year 1997. Three columns, Region.RegionDescription, CategoryName, CountOfOrders.

  1. Show a list of Regions and the names of employees that have territories in those regions.
  2. Copy #1. Show a list of Regions, and OrderIds from Orders in 1997 from each region.
  3. Copy #2. Show a list of Regions, and ProductIDs from Orders in 1997 from each region.
  4. Copy #3. Show a list of Regions, and the Category Name of Products from Orders in 1997 from each region.
  5. Copy #4. Show the Region, Category, and Count of Orders in 1997.
  6. Copy #5. Show the DISTINCT count of orders.

Reference no: EM13718188

Questions Cloud

Determine how high will the block rise into the air : A gun fires a bullet vertically into a 1.40-kg block of wood at rest on a thin horizontal sheet. how high will the block rise into the air after the bullet becomes embedded in it
Determine the entropy change of nitrogen during this process : A piston-cylinder device contains 1.101 kg of nitrogen gas at 120 kPa and 27 degrees C. The gas is now compressed slowly in a poly tropic process which PV^(1.38) = constant. The process ends when the volume is reduced by one-half. Determine the entro..
How fast is the flowerpot moving in two seconds : A flowerpot falls from a windowsill 25 m above a sidewalk. How fast is the flowerpot moving in 2 seconds
Examine specific ways and events : Discussion, examine specific ways, events, characterizations, places, times, imagery, symbolism, etc., unfolds the story of the myth or folktale or satire.
How many different customers have ordered products : How many different customers have ordered products in each category? Two columns, categoryname and count of distinct customers. Make sure to include EVERY category.
Estimate what will be their speeds after the collision : Two billiard balls of equal mass undergo a perfectly elastic head-on collision. what will be their speeds after the collision
Adiabatic compressor with an isentropic efficiency : Air is compressed from 100 kPa and 20C to 700 kPa in an adiabatic compressor with an isentropic efficiency of 90%. Assuming that the mass flow rate is 0.1 kg/s determine the power input to this compressor, in kW, and the rate of entropy generated. Us..
What is the index of refraction of octane : The speed of light in octane is 2.14×108m/s. What is the index of refraction of octane
Evaluate the speed of the puck after the collision : A 0.450-kg ice puck, moving east with a speed of 5.26m/s , has a head-on collision with a 0.950-kg puck initially at rest. What is the speed of the 0.950-kg puck after the collision

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What security concerns might arise over mobile access

What security concerns might arise over mobile access to private corporate information

  Write an isr in c to add the signed value on port t (ptt)

Write an ISR, in C, to add the signed value on PORT T (PTT) to the byte value stored in location data1.

  Write the code to play a number guessing game

HW#5:Write the code to play a number guessing game.

  Report on explaining how to recover corrupt file

When you try to open the file in an image viewer, a message is displayed indicating that the file is corrupt. Write a 2-3 page report explaining how to recover the file, orkty.zip, for further investigation.

  What interface does an application need to use

What interface does an application need to use if it wants to get updates on the current position of the mouse cursor as the mouse is being moved?

  Let x represent the number of hours catelyn works at the

question catelyn has two summer jobs. each week she works at least 15 hours at a pet store and at least 6 hours as a

  Function in programs to print upside down triangles

Apply function in programs to prints triangles, upside down triangles, and diamond.

  What protocol unit is being used in layer 2

Network switches provide essential connectivity in local and wide area networks. Some of them run in multilayer between layers 2 and 3. What protocol unit is being used in layer 2?

  Use html5 to create a document that contains

Insert a horizontal rule between the h1 element and the p element. Open your new document in a web browser to view the marked up document.

  Compute the approximate nth root of x

Problem: Given a positive integer n and a positive integer x compute the approximate nth root of x.

  Difference and similarity between matlab and vba syntax

1. What's one difference you've noticed between MATLAB and VBA syntax? What is one similarity?

  Ways in which time-dependent signals can be classified

•Discuss some ways in which time-dependent signals can be classified. •Discuss what is meant by "basic signal representation" and the advantage of this type of representation.

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