Select the total number of shippers for orders

Assignment Help C/C++ Programming
Reference no: EM131451788

Assignment

Using the example below based on a dummy table and its values and after watching the video on aggregates answer the following questions:

Various Aggregate Functions
1) Count()
2) Sum()
3) Avg()
4) Min()
5) Max()

Now let us understand each Aggregate function with a example:

Id    Name   Salary
1       A         80
2       B         40
3       C         60
4       D         70
5       E         60
6       F         Null

Count():

Count(*): Returns total number of records .i.e 6.

Count(salary): Return number of Non Null values over the column salary. i.e 5.

Count(Distinct Salary): Return number of distinct Non Null values over the column salary .i.e 4

Sum():

sum(salary): Sum all Non Null values of Column salary i.e., 310
sum(Distinct salary): Sum of all distinct Non-Null values i.e., 250.

Avg():

Avg(salary) = Sum(salary) / count(salary) = 310/5
Avg(Distinct salary) = sum(Distinct salary) / Count(Distinct Salary) = 250/4

Min():

Min(salary): Minimum value in the salary column except NULL i.e., 40.
Max(salary): Maximum value in the salary i.e., 80.

/* Question 1: Select the total number of Products in the Products table */

/* Question 2: Select the total number of Shippers for Orders (Hint: use COUNT(ShipVia) as TotalProducts to return non-null counts. (You will notice that by doing a select * from Orders there are ShipVia foreign keys as NULLs. As a result the count will exclude it while counting.) */

/* Question 3: Select the total number of DISTINCT Shippers for Orders (Hint: use COUNT(Distinct ShipVia) to return non-null counts. (You will notice that by doing a select * from Orders there are ShipVia foreign keys as NULLs and there are duplicate ShipVia. As a result the count distinct will exclude both while counting.) */

/* Question 4: Select all non-null total price from Order Details where OrderID = 10248 (Hint Use SUM(UnitPrice * Quantity) as OrderTotal) */

/* Question 5: Select all non-null distinct non-null freight charges from the Orders table (Hint: Use SUM(DISTINCT Freight) as TotalFreight where CustomerID = 'VINET' */

/* Question 6: Select all non-null distinct total products that were ordered from the Order Details table (Hint: Use COUNT(DISTINCT ProductID) as TotalProducts */

/* Question 7: Select average unitprice of Products */
/* Question 8: Select ProductName and UnitPrice pf Products that have an above average price:

(Hint: Use a sub-query similar to one done during class exercise to first write sub-query to select Average UnitPrice of Products and then using a where clause (UnitPrice > (subquery)) as part of the outer query select ProductName and UnitPrice)

*/

/*
Question 9a: Select Product having the maximum UnitPrice
Question 9b: Select Product having the minimum UnitPrice
*/

/* Question 10: Select CompanyName, count(OrderID) as NumberOfOrders grouped by shippers
(Hint: Use inner join to join Orders and Shippers and then use Group By CompanyName refer to the video and lecture notes)
*/

Reference no: EM131451788

Questions Cloud

How much would you request for your meal reimbursements : Your company policy on reimbursement for meals while travelling on company business is that you will be repaid for your out-of-pocket costs.
Create program to display a 2d view of grid-based simulation : CS408 Assignment 5 - Create a program to display a 2D view of grid-based simulation of gas moving in a flat space. See on-line notes on Gaseous Phenomena.
Would government subsidies apply to your type of program : What, specifically, the funding source is (e.g., If it's a government subsidy, from what specific agency might your child development center derive funds?)
Make contact with the individual with the goal of persuading : You have discovered that one of your closest friends at work has stolen a large sum of money from the company. Would you do nothing?
Select the total number of shippers for orders : Select the total number of Shippers for Orders (Hint: use COUNT(ShipVia) as TotalProducts to return non-null counts.
Briefly describe the segmentation and targeting process : Segmentation & targeting-Briefly describe the segmentation and targeting process, acknowledging its relevance to B2C and B2B marketing
What benefits do you think syncrude might derive : Fort McMurray, Alberta-based Syncrude is "the largest nongovernmental employer of Aboriginal people in Canada." The company, the largest producer of light.
The significance of the concordia regularis is : The prop, which is central in convincing Othello of Desdemona's infidelity, is. Desdemona meets her end when.Roderigo desires Desdemona for.
What could westjet do to prevent this type of ruthless : Sneaky moves, claims of corporate espionage, and shredded documents. This is not a fictitious spy thriller, but a true story of rivalry in the Canadian airline.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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