The average amount of their orders , Database Management System

Assignment Help:

Make SQL statements for the following scenarios. Your response should contain SQL statement, output and any other assumptions you have made to arrive at the answer.
For Colorado customers compute the average amount of their orders and the number of orders placed. The result should contain the customer number, customer last name, average order amount and the number of orders placed.

Query:

selectc.CUSTFIRSTNAME, c.CUSTLASTNAME, avg(p.PRODPRICE), count(ol.ORDNO) from customer c,ordertblot,ordlineol,product p where c.custno=ot.custno and ot.ordno=ol.ordno and p.PRODNO=ol.PRODNO group by c.CUSTFIRSTNAME,c.CUSTLASTNAME;

440_00.png


Related Discussions:- The average amount of their orders

Define outer union operation of the relational algebra, Define outer union ...

Define outer union operation of the relational algebra. Compute the outer union for the relations R and S given below. Outer Join - If there are any values in one tabl

Explain derived and non-derived attribute, Explain Derived and Non-Derived ...

Explain Derived and Non-Derived Attribute? In few cases, two or more attribute values are related, for instance, Age and BirthDate attributes of a person. For specific person e

Explain the disadvantages of file oriented approach, Explain the disadvanta...

Explain the disadvantages of file oriented approach? In the oriented approach Applications are designed in isolation. Design of application is optimized for one application. In

Explain the terms primary key, Explain the terms primary key, candidate key...

Explain the terms primary key, candidate key, alternate key and secondary key. In the given table identify every key? STUDENT(SID,Regno, Name, City) Primary Key: The prim

What are the uses of the information in the data dictionary, What are the u...

What are the uses of the information in the Data dictionary? The following information is directly taken from the Data dictionary: Information on fields displayed with

Evaluate the null hypothesis, 1.Suppose you are given a dataset that consis...

1.Suppose you are given a dataset that consists of a random sample of tasters, on which the following variables were obtained: (y) Zpref = taste preference for green beans store

User error-database errors, User error :  This contains errors in the progr...

User error :  This contains errors in the program (e.g., Logical errors) with errors made by online users of database.  These types of errors can be avoided by applying some check

Union - basic set operation, UNION If R1 and R2 are two union compatibl...

UNION If R1 and R2 are two union compatible relations then R3 = R1 ∪ R2 is the relation having tuples that are either in R1 or in R2 or in both. In case, R3 will have tuples

Concurrency control, Give the two reasons for allowing concurrency

Give the two reasons for allowing concurrency

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd