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

Define Normalization with example?

1 Answers  


Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?

0 Answers  


how to find out second largest value in the table

8 Answers  


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

0 Answers   Infosys,


what is the syntax of UPDATE command?

8 Answers  






I have a table that log salary-increase-process have fields: autoid, old_salary, acctno and table EMP: acctno, name, salary I want to list count increase-salary of employees, each have old_salary, new_salary. Help me with SELECT statement, please!

1 Answers  


emp numb is unique because that is primary key,,but what is foreign key .. explain very clear with example

1 Answers  


How to get last row id?

0 Answers  


what is main def between plsql/table and array?

1 Answers   Oracle,


What a SELECT FOR UPDATE cursor represent.?

1 Answers  


how to insert data into partitioned table partition done by Range partition

1 Answers  


What is the data pump import utility?

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)