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
Distributed databases and data warehouses would be considered which data model type?
joja [24]

Circulated databases and data warehouses would be deemed the data model type as Data source types.

<h3>What is the database explain?</h3>
  • A database is an indexed array of structured knowledge, or data, generally stored electronically in a computer system.
  • A database is usually maintained by a database management system (DBMS).
  • A database is an organized collection of data. They own electronic storage and manipulate data. Databases make data control easy.
  • Allow us to explore a database instance: An online telephone directory uses a database to store data of people, phone numbers, and other contact details.
  • Databases are used for keeping, preserving, and accessing any type of data.
  • They gather data on people, places, or things. That data is collected in one place so that it can be observed and analyzed. Databases can be considered as an arranged collection of information.

To learn more about Data source types, refer to:

brainly.com/question/26928042

#SPJ4

8 0
1 year ago
NEED HELP FAST
olganol [36]
The answer is b absloute is very incorrect because the ressinanse is a very important period


3 0
2 years ago
Read 2 more answers
This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
AVprozaik [17]

Answer: his cpu fan may not be working properly

Explanation:

8 0
3 years ago
PLEASE ANSWER
Andrej [43]

Answer:

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

7 0
2 years ago
With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
kirza4 [7]

Answer:

Phishing

Explanation:

Phishing is a social engineering attack where users are asked to respond to an email or are directed to a website where they are requested to login with their personal credentials, such as passwords or credit card numbers.

How Phishing Works?

The attacker first carefully designs a web page identical to a real bank with fine details. Then attacker persuades the victim to go to this fake web page with login screen. The attacker gets all the information typed and enter into that fake web page. The victim often thinks that this is exactly my bank's web page so nothing is going to happen if I put log in credentials.

How to avoid Phishing?

This kind of attack can always be spotted with one simple trick. Check the address of the web page carefully. The attacker can design the web page according to his wish but he cannot have control over the web address of a real bank or real a website.  

Some general safety tips are:

  • Don't open links from spam emails.
  • Don't download malicious software.
  • Don't share personal information with strangers
7 0
3 years ago
Other questions:
  • Which computing component is similar to the human brain
    6·2 answers
  • Your motherboard supports dual channeling and you currently have two slots used in channel a on the board; each module holds 1 g
    15·1 answer
  • How is a recession determined?
    10·1 answer
  • 2
    11·1 answer
  • 2. From the listing code, please give the block of line numbers for code which are concerned with the following: A) Main functio
    5·1 answer
  • When should recursion be avoided?
    9·1 answer
  • How do the companies gather data to determine common passwords?
    13·1 answer
  • A garments manufacturing company buys various types of natural and synthetic materials to produce clothes. Which material is a s
    6·2 answers
  • A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four organizations, Able, Baker, C
    11·1 answer
  • nts/viewer/classes/289ef1a5d7c341c284010 Select the compound inequality shown on the graph. 5 4 3 2 1 0 1 2 를 4​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!