SQL List the item ID, description, and on-hand value of each item whose number of units on hand is more than the average number of units on hand for all items. The output table should have the following column headers: ITEM_ID, DESCRIPTION, and ON_HAND_VALUE. Make sure to create a sub-query to get the average on hand value of all items in the ITEM table in order to determine which items have more than the current average on hand.

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

SQL

List the item ID, description, and on-hand value of each item whose number of units on hand is more than the average number of units on hand for all items.

The output table should have the following column headers: ITEM_IDDESCRIPTION, and ON_HAND_VALUE.

Make sure to create a sub-query to get the average on hand value of all items in the ITEM table in order to determine which items have more than the current average on hand.

ITEM_ID
DESCRIPTION
ON_HAND
CATEGORY
LOCATION
PRICE
AD72
Dog Feeding Station
12
DOG
B
79.99
BC33
Feathers Bird Cage (12x24x18)
10
BRD
В
79.99
CA75
Enclosed Cat Litter Station
15
CAT
39.99
DT12
Dog Toy Gift Set
27
DOG
B
39.99
FM23
Fly Mask with Ears
41
HOR
24.95
FS39
Folding Saddle Stand
12
HOR
39.99
FS42
Aquarium (55 Gallon)
FSH
A
124.99
KH81
Wild Bird Food (25 Ib)
24
BRD
19.99
LD14
Locking Small Dog Door
14
DOG
A
49.99
LP73
Large Pet Carrier
23
DOG
B
59.99
Transcribed Image Text:ITEM_ID DESCRIPTION ON_HAND CATEGORY LOCATION PRICE AD72 Dog Feeding Station 12 DOG B 79.99 BC33 Feathers Bird Cage (12x24x18) 10 BRD В 79.99 CA75 Enclosed Cat Litter Station 15 CAT 39.99 DT12 Dog Toy Gift Set 27 DOG B 39.99 FM23 Fly Mask with Ears 41 HOR 24.95 FS39 Folding Saddle Stand 12 HOR 39.99 FS42 Aquarium (55 Gallon) FSH A 124.99 KH81 Wild Bird Food (25 Ib) 24 BRD 19.99 LD14 Locking Small Dog Door 14 DOG A 49.99 LP73 Large Pet Carrier 23 DOG B 59.99
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Multiple table
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.
Similar questions
  • SEE MORE 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