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

what are the different types of cursors? explain?

4 Answers  


Explain the features of oracle?

0 Answers  


What is the oracle implicit cursor?

0 Answers  


What is the function of Optimizer ?

1 Answers  


What is a public synonym?

1 Answers  






5. Display full details from the ORDER_LINE table where the item number is (first condition) between 1 and 200 (no > or < operators) OR the item number is greater than 1000 AND (second condition) the item cost is not in the list 1000, 2000, 3000 OR the order number is not equal to 1000.

3 Answers   Wipro,


How to make a Data Backup in oracle ? What is the procedure for creating the dump files in oracle ( any version ) ?

3 Answers   Satyam,


What is SAVE POINT ?

5 Answers  


What is a connect identifier?

0 Answers  


What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?

1 Answers  


What are the factors that affect OPTIMIZER in choosing an Optimization approach ?

2 Answers  


Will you be able to store pictures in the database?explain.

0 Answers  


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)