SESSION NAME: SQL Functions - 1.
QUESTION NAME: Sum and Average of Items ordered.
TABLE DESCRIPTION:Write a query that prints the sum and average
of the customerid, quantity and price.
Note: Use SQL in-built Function to calculate the sum and
average of the tuples in items_ordered table.
The statement has to return a single result which
contains the sum and average value of customerid,
quantity and price columns of everything returned in the
items_ordered table.
of the customerid, quantity and price.
Note: Use SQL in-built Function to calculate the sum and
average of the tuples in items_ordered table.
The statement has to return a single result which
contains the sum and average value of customerid,
quantity and price columns of everything returned in the
items_ordered table.
CODE:
select sum(customerid),sum(quantity),sum(price),avg(customerid),avg(quantity),avg(price) from items_ordered;
0 Comments