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
structured analysis is called a(n) _____ technique because it focuses on processes that transform data into useful information.
zzz [600]

Answer:

Process - centered technique

Explanation:

Process - centered technique -

It is the method , where the useless or waste data is converted to some useful information , is referred to as process - centered technique .

This conversion process requires some activities , like  maintenance/support  , implementation , design , analysis and  planning .

Hence , from the given information of the question,

The correct option is Process - centered technique .

4 0
3 years ago
Write a program to implement problem statement below; provide the menu for input N and number of experiment M to calculate avera
zalisa [80]

Answer:

Explanation:

#include<iostream>

#include<ctime>

#include<bits/stdc++.h>

using namespace std;

double calculate(double arr[], int l)

{

double avg=0.0;

int x;

for(x=0;x<l;x++)

{

avg+=arr[x];

}

avg/=l;

return avg;

}

int biggest(int arr[], int n)

{

int x,idx,big=-1;

for(x=0;x<n;x++)

{

if(arr[x]>big)

{

big=arr[x];

idx=x;

}

}

return idx;

}

int main()

{

vector<pair<int,double> >result;

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

int choice;

cin>>choice;

while(choice!=2)

{

int n,m;

cout<<"Enter N"<<endl;

cin>>n;

cout<<"Enter M"<<endl;

cin>>m;

int c=m;

double running_time[c];

while(c>0)

{

int arr[n];

int x;

for(x=0;x<n;x++)

{

arr[x] = rand();

}

clock_t start = clock();

int pos = biggest(arr,n);

clock_t t_end = clock();

c--;

running_time[c] = 1000.0*(t_end-start)/CLOCKS_PER_SEC;

}

double avg_running_time = calculate(running_time,m);

result.push_back(make_pair(n,avg_running_time));

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

cin>>choice;

}

for(int x=0;x<result.size();x++)

{

cout<<result[x].first<<" "<<result[x].second<<endl;

}

}

8 0
2 years ago
Sheila is using a process of saving files to her desktop and then renaming them. She is
inessss [21]

Answer: D

Use the internet to search for a new app to rename the folder.​

Explanation:

Rename function is used to change the name of the file or directory i.e. from old_name to new_name without changing the content present in the file. This function takes name of the file as its argument. There are many alternatives to this in which Sheila can found out through the internet.

5 0
3 years ago
Read 2 more answers
Which of these devices features D-pads and analog sticks? ASAP PLEASE
Arisa [49]

Answer:

b. portable consoles

Explanation:

hope that helps :)

5 0
3 years ago
Read 2 more answers
PLZZ HELP!!!
Serga [27]

Answer:

I don't know

Explanation:

with data you can access all things in the world

8 0
3 years ago
Other questions:
  • Why is it important to respect other political opinions
    7·2 answers
  • The set of rules for how computers talk to one another is called
    12·1 answer
  • In total, how many 8-bit registers are there in the Intel 80x86 CPU design presented in class? Name one of these 8-bit registers
    9·1 answer
  • A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption
    10·1 answer
  • D is the correct answer
    8·2 answers
  • Write two example use of relationships ICT
    11·1 answer
  • What two windows security updates do most organizations always patch?
    7·1 answer
  • Please answer this question​
    8·1 answer
  • If there are over 1,000 websites about a certain topic, the information is reliable. A. True B. False
    12·1 answer
  • Como interactua el hardware de la computadora con el ser humano
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!