(2) Consider the following Orders table. Write one SQL query that will compute the following from this table: (i) total number of orders, (ii) average purchase amount, (iii) maximum purchase amount, (iv) minimum purchase amount, and (v) total number of customers with purchase amounts greater than $1000. ord_no purch_amt ord_date customer_id salesman_id 70001 150.50 2012-10-05 3005 5002 70009 270.65 2012-09-10 3001 5005 70002 65.26 2012-10-05 3002 5001 70004 110.50 2012-08-17 3009 5003 70007 948.50 2012-09-10 3005 5002 70005 2400.60 2012-07-27 3007 5001 70008 5760.00 2012-09-10 3002 5001 70010 1983.43 2012-10-10 3004 5006 70003 2480.40 2012-10-10 3009 5003 70012 250.45 2012-06-27 3008 5002 70011 75.29 2012-08-17 3003 5007 70013 3045.60 2012-04-25 3002 5001

Database Systems: Design, Implementation, & Management
11th Edition
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Chapter11: Database Performance Tuning And Query Optimization
Section: Chapter Questions
Problem 2P: Problem 1 and 2 are based on the following query: SELECT EMP_LNAME, EMP_FNAME, EMP_AREACODE, EMP_SEX...
icon
Related questions
Question
100%
(2) Consider the following Orders table. Write one SQL query that will
compute the following from this table: (i) total number of orders, (ii)
average purchase amount, (iii) maximum purchase amount, (iv)
minimum purchase amount, and (v) total number of customers with
purchase amounts greater than $1000.
ord no purch_amt ord_date
customer_id salesman_id
70001
150.50
2012-10-05
3005
5002
70009
270.65
2012-09-10
3001
5005
70002
65.26
2012-10-05 3002
5001
70004
110.50
2012-08-17
3009
5003
70007
948.50
2012-09-10
3005
5002
70005
2400.60
2012-07-27 3007
5001
70008
5760.00
2012-09-10
3002
5001
70010
1983.43
2012-10-10
3004
5006
70003
2480.40
2012-10-10
3009
5003
70012
250.45
2012-06-27
3008
5002
70011
75.29
2012-08-17
3003
5007
70013
3045.60
2012-04-25
3002
5001
Transcribed Image Text:(2) Consider the following Orders table. Write one SQL query that will compute the following from this table: (i) total number of orders, (ii) average purchase amount, (iii) maximum purchase amount, (iv) minimum purchase amount, and (v) total number of customers with purchase amounts greater than $1000. ord no purch_amt ord_date customer_id salesman_id 70001 150.50 2012-10-05 3005 5002 70009 270.65 2012-09-10 3001 5005 70002 65.26 2012-10-05 3002 5001 70004 110.50 2012-08-17 3009 5003 70007 948.50 2012-09-10 3005 5002 70005 2400.60 2012-07-27 3007 5001 70008 5760.00 2012-09-10 3002 5001 70010 1983.43 2012-10-10 3004 5006 70003 2480.40 2012-10-10 3009 5003 70012 250.45 2012-06-27 3008 5002 70011 75.29 2012-08-17 3003 5007 70013 3045.60 2012-04-25 3002 5001
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr