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
Data cannot be sorted of filtered accurately if there are ________.
ruslelena [56]
<span>c. blank fields or records
</span>
5 0
2 years ago
Read 2 more answers
In disc brakes, pads are forced against the of a brake disc​
Arturiano [62]

Answer:

Explanation:

It's the surface the brake pads contact. When you step on the brakes, pressurized brake fluid pushes against the pistons inside the caliper, forcing the brake pads against the rotor. As the brake pads press against both sides of the disc, the friction stops the wheel's rotation.

6 0
2 years ago
Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
olga nikolaevna [1]

Complete Question:

Which of the following statement is true?

Group of answer choices.

A. When declaring a variable, you also specify the type of its values.

B. Variables cannot be assigned and declared in the same statement.

C. Variable names can be no more than 8 characters long.

D. Variable names must contain at least one dollar sign.

Answer:

A. When declaring a variable, you also specify the type of its values.

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

For instance, to pass a class to a family of classes use the code;

\\parameter Name as Type (Keywords) = value;

\\procedure XorSwap (var a,b :integer) = "myvalue";

<em>Hence, the true and correct statement is that when declaring a variable, you also specify the type of its values such as integers, string, etc. </em>

6 0
2 years ago
Illia is a network administrator at a company.which tasks is she responsible for
irina1246 [14]

Answer: They organize, install, and support an organization's computer systems, including local area networks (LANs), wide area networks (WANs), network segments, intranets, and other data communication systems.

Explanation:

6 0
2 years ago
What is the best wi-fi name you have ever seen?
elena-s [515]

Answer:

bill wi the science fi

Explanation:

8 0
2 years ago
Other questions:
  • This stores a piece of data and gives it a specific name
    7·1 answer
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • I NEED IT FOR TODAY FOR KEYBOARDING TEST! GIVE ME CORRECT ANSWER PLZ!
    12·2 answers
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Describa la clasificación de los recursos educativos digitales abiertos. vea este video, para hacer eso
    11·2 answers
  • CSCU EXAM TEST FINAL1-A software or hardware that checks information coming from the Internet and depending on the applied confi
    6·1 answer
  • If you're a beginner to data analysis, what is the first thing you should check when you build data queries?
    11·1 answer
  • A system engineer enhances the security of a network by adding firewalls to both the external network and the internal company n
    11·1 answer
  • Missing appropriate security hardening across any part of the application stack or improperly configured permissions is an examp
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!