1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexgriva [62]
3 years ago
7

Write a SQL statement to display the WarehouseID, the sum of Quantity On Order, and the sum of QuantityOnHand, grouped by Wareho

useID and Quantity Order. Name the sum of QuantityOnOrder and the sum of QuantityOnHand as TotalItemsOnHand. Use only the INVENTORY table in your SQL statement.
Computers and Technology
1 answer:
mariarad [96]3 years ago
3 0

Answer:

The corrected question is:

Write an SQL statement to display the WarehouseID, the sum of QuantityOnOrder and sum of QuantityOnHand, grouped by WarehouseID and QuantityOnOrder. Name the sum of QuantityOnOrder as TotalItemsOnOrder and the sum of QuantityOnHand as TotalItemsOnHand. Use only the INVENTORY table in your SQL statement.

Answer to this corrected question:

SELECT WarehouseID,

SUM(QuantityOnOrder) AS TotalItemsOnOrder,

SUM(QuantityOnHand) AS TotalItemsOnHand

FROM INVENTORY

GROUP BY WarehouseID, QuantityOnOrder;

According to the given question:

SELECT WarehouseID,

SUM(QuantityOnOrder) + SUM(QuantityOnHand) AS TotalItemsOnHand    

FROM INVENTORY

GROUP BY WarehouseID, QuantityOnOrder;

Explanation:

  • In the SQL statement SELECT statement is used to select the data from the table. Here the SELECT statement is used to select WarehouseID, Sum of the columns QuantityOnOrder and QuantityOnHand from INVENTORY table.
  • The sum of QuantityOnOrder and QuantityOnHand columns are given the name of TotalItemsonHand (In case of the corrected question the sum of column QuantityOnOrder is named as TotalItemsOnOrder and the column QuantityOnHand is named as TotalItemsOnHand ) using Alias AS. Alias is the temporary name given to the columns or table to make them  more readable.
  • GROUP BY statement is used to arrange or "group" same data and is often use with aggregate functions like SUM function here. So the grouping here is done based on two columns WarehouseID and QuantityOnOrder.
  • SUM function in this SQL statement is an aggregate function to calculate the sum of all value in the columns QuantityOnOrder and QuantityOnHand.
You might be interested in
1. Our Systems are Microsoft Dynamics OLTP, we move data from the Source Systems through Staging to a Data Warehouse. Our report
zmey [24]

Answer:

1. More access to data

2.convenience

3. Easy creation of BI solutions

4. Report creation

5. Saves time

Explanation:

A data warehouse can be described to be an electronic storage system that contains large amount of facts and information which sources for and also maintains data from different sources; either external or internal.

The most important reason for a data warehouse is for it to store great amounts of data to be used for query and also to be used for analysis.

Why do we use a data warehouse?

1. Users have more access to data due to the integration of various sources of data. It makes use of real time data facts

2. You can conveniently store and also create metadata

3. Business intelligence solutions can easily be created using data warehouses.

4. Users can easily create their own reports

5. Data warehouses makes accessing different data sets faster. It is a time saver as business users are not going to spend time trying to retrieve data from various sources.

4 0
3 years ago
Which term describes unjust behavior due to a person’s gender or race
Alexandra [31]

Answer:

Discrimination

Explanation:

8 0
3 years ago
Which of the following are computer safety techniques? Check all of the boxes that apply.Identify Computer Safety Techniques:
zvonat [6]

Answer: Protect the system with a password  

               Use spam protection.

               Avoid using questionable software.

               

Explanation:

4 0
3 years ago
A brochure describing the benefits of a product to the target audience is an example of which type of document?
Setler79 [48]

Answer:

The answer is "a design proposal "

Explanation:

The brochure is just a paper document that could be embedded in design, poster, and flyer. It is also often used for advertising purposes. Its design process, which becomes an imaginative process through which requirements were identified and process designed for the desires, that's why the above-given option is a correct and wrong choice can be defined as follows:

  • The choice design brief is wrong because it is a written explanation.
  • The choice design critique is wrong because it used to analyze the design.
  • In choice design medium, it is processed in which design is prepared, that's why it is wrong.
8 0
3 years ago
Read 2 more answers
How do you open the two versions of internet explorer 10?
Crank
On which windows it's not hard just search it google i would help but i hadn't used computer since may
5 0
3 years ago
Other questions:
  • Of the different IRT roles, the _______________ is head of the team and issues the ultimate call regarding how to respond to an
    15·1 answer
  • How to write a program converting RGB to CMYK in python
    6·1 answer
  • What additive keeps engines clean by preventing contaminates and deposits from collecting on surfaces? a. Friction modifiers b.
    10·2 answers
  • Researchers conducted a 'natural experiment' to examine the effects of on-site food services on weight gain among first-year col
    13·1 answer
  • You are sending an email to a coworker requesting that the coworker perform a task. Where should you put your coworker's email a
    8·1 answer
  • can I do all my work in a notebook with Penn foster or do I have to type all of the answers in that little box?
    7·2 answers
  • Why did latex replace wax?
    7·1 answer
  • Which organization publishes a handbook that describes various occupations? U.S. Department of Defense U.S. Department of Agricu
    15·1 answer
  • How many jobs can you get without a college degree
    13·2 answers
  • What would provide structured content that would indicate what the code is describing ?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!