This is the only problem I\'m having issues with. This is using SQL Plus. When I
ID: 638600 • Letter: T
Question
This is the only problem I'm having issues with.
This is using SQL Plus.
When I input the code I receive the following error:
ORA-00934: group function is not allowed here
This is what I put but it didn't work:
SELECT prod_id, prod_desc, prod_price
FROM products
WHERE prod_quantity >
(SELECT AVG(prod_quantity)
FROM products)
ORDER BY prod_quantity DESC;
The table that's referenced is this one:
PROD_ PROD_DESC PROD_QUANTITY PR P PROD_PRICE
----- -------------------- ------------- -- - ----------
BT105 Blender 52 HW A 24.95
BZ117 Exercise Bicycle 47 SG C 283.95
CE163 Convection Oven 28 AP B 186
DM182 Electric Screwdriver 23 HW A 49.95
DS104 Electric Range 6 AP C 395
DW111 Clothes Washer 14 AP A 399.99
FP132 Plasma Television 15 HW A 999.95
KM173 Clothes Dryer 16 AP B 349.95
KW114 Dishwasher 7 AP C 435
KG130 Home Workout Center 5 SG C 1390
RD147 HD Radio 7 HW B 280
11 rows selected.
SQL> DESCRIBE product;
Name Null? Type
----------------------------------------- -------- ----------------------------
PROD_ID NOT NULL CHAR(5)
PROD_DESC VARCHAR2(20)
PROD_QUANTITY NUMBER(38)
PROD_TYPE CHAR(2)
PROD_WAREHOUSE CHAR(1)
PROD_PRICE NUMBER(7,2)
Explanation / Answer
SELECT is, description, value FROM Products WHERE Units > (SELECT AVG(Units) FROM Products) ORDER BY Units DESC
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.