24. Display the order number for all orders whose average
item cost is greater than the overall average item cost
across all orders.

Answers were Sorted based on User's Feedback



24. Display the order number for all orders whose average item cost is greater than the overall ave..

Answer / sarath

select ORDER_NO,AVG(ITEM_COST) from <TN>
Group by ORDER_NO
having AVG(ITEM_COST) > (Select Max(AVG(ITEM_COST)) from
<TN> Group by ORDER_NO)

Is This Answer Correct ?    2 Yes 1 No

24. Display the order number for all orders whose average item cost is greater than the overall ave..

Answer / sarath

Small correction to the above answer. Its not MAX, but AVG
Sorry for the mistake

select ORDER_NO,AVG(ITEM_COST) from <TN>
Group by ORDER_NO
having AVG(ITEM_COST) > (Select AVG(AVG(ITEM_COST)) from
<TN> Group by ORDER_NO)

This is to display the Order no whose AVG is > Resultant AVG of All Order's AVG(ITEM _Cost)

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Oracle General Interview Questions

Please explain joins in oracle?

0 Answers  


Hi how Can I Add A Foreign key that references a table that has composit primary key ? example i had costumer table that has C_Id and SSN Both as PK and another table has C_Id that must refernece C_Id in Customers i done the usual way and got oracle error message about uniqeness any ideas plz

2 Answers  


What are inner join and outer join?

3 Answers  


Table E: Name dept month sal 1 A JAN 800 2 B APR 1000 3 A JAN 300 4 A JAN 600 5 C JUN 400 1) SELECT HIGHEST SAL PAID DEPT IN JAN MONTH? 2) WRITE QUERY GET MAX SAL DEPT NO?

6 Answers   IBM,


How to create a new user account in oracle?

0 Answers  






What is rich query?

0 Answers  


How many anonymous blocks can be defined?

0 Answers  


how to i write the query 'NISHI' TO N I S H I

4 Answers   Attra, Metric Stream,


What is an Oracle view?

1 Answers  


What is recovery manager in Oracle?

0 Answers   MCN Solutions,


How to drop a tablespace?

0 Answers  


The join defined by the default data link is an outer join yes or no ?

1 Answers   Oracle,


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)