mysql> select from customer_db; +- | cust_id❘ cust_name | cust_hname | cust_street | cust_phone | 1 pallasigue | 5252abc 2 | riya 3 adan 6196 | 443567 | 6199 98765 | | curryst 8 | sean | 123abc 57abc | 12345abc | 123abc | diablo curryst tommy | diablo 443567 | 9 riya -+- 5 rows in set (0.00 sec) mysql> select * from order_db; +- | orderid | custid | itemcode | orderquantity | deliverydate | modeofpayment | date_of_order | | 2020-05-28 | 1998-02-15 2024-09-03 250 | 2 2 800 | 2020-05-30 | C 200 | 2 | 2 | 600 | 2021-09-21 R 500 | 2 | 2 | 125 2023-06-02 D 300 | 2 2 200 | 2020-05-29 I c | 1998-02-15 75 | 21 2 265 | 2020-05-29 | C | 1998-02-15 5 rows in set (0.00 sec)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

The course I'm taking is database management. 

I have attached the necessary information for question. Please provide solution in detail so i can better understand why. I need solution query for part A and B utilizing SUBQUERY. Thank you in Advance!

 

Part A -  Display the order details of all orders where order quantity exceeds the average of order
quantity.

Part B - Display all orders whose order quantity is greater than the maximum order quantity of
'curryst' customers.

mysql> select from customer_db;
+-
| cust_id❘ cust_name | cust_hname | cust_street | cust_phone |
1 pallasigue | 5252abc
2 | riya
3 adan
6196 |
443567 |
6199
98765 |
| curryst
8 | sean
| 123abc
57abc
| 12345abc
| 123abc
| diablo
curryst
tommy
| diablo
443567 |
9 riya
-+-
5 rows in set (0.00 sec)
mysql> select * from order_db;
+-
| orderid | custid | itemcode | orderquantity | deliverydate | modeofpayment | date_of_order |
| 2020-05-28
| 1998-02-15
2024-09-03
250 |
2
2
800 | 2020-05-30 | C
200 |
2 |
2 |
600 | 2021-09-21
R
500 |
2 |
2 |
125 2023-06-02
D
300 |
2
2
200 | 2020-05-29
I c
| 1998-02-15
75 |
21
2
265 | 2020-05-29
| C
| 1998-02-15
5 rows in set (0.00 sec)
Transcribed Image Text:mysql> select from customer_db; +- | cust_id❘ cust_name | cust_hname | cust_street | cust_phone | 1 pallasigue | 5252abc 2 | riya 3 adan 6196 | 443567 | 6199 98765 | | curryst 8 | sean | 123abc 57abc | 12345abc | 123abc | diablo curryst tommy | diablo 443567 | 9 riya -+- 5 rows in set (0.00 sec) mysql> select * from order_db; +- | orderid | custid | itemcode | orderquantity | deliverydate | modeofpayment | date_of_order | | 2020-05-28 | 1998-02-15 2024-09-03 250 | 2 2 800 | 2020-05-30 | C 200 | 2 | 2 | 600 | 2021-09-21 R 500 | 2 | 2 | 125 2023-06-02 D 300 | 2 2 200 | 2020-05-29 I c | 1998-02-15 75 | 21 2 265 | 2020-05-29 | C | 1998-02-15 5 rows in set (0.00 sec)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education