need summarized info in the sql join queries

  • For each value of PC speed that exceeds 600 MHz, define the average price of the PCs with identical speeds.

    Result set: speed, average price.

    TRY executing the following syntax.

    select speed, avg(price) as AVG_PRICE from pc where speed>600 group by speed

    Right.

    The result of Your query:

    speedAVG_PRICE

    750900.0000

    800970.0000

    900980.0000

  • hey!

    use this code you will get the desired output.

    SELECT distinct SPEED, AVG(PRICE) as AVG_PRICE FROM PC GROUP BY SPEED

    HAVING SPEED>600

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply