A doubtful question
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: A doubtful question

  1. #1
    Join Date
    Feb 2002
    Posts
    166
    The product table contains these columns.
    ID NUMBER(9) PK
    COST NUMBER(7,2)
    SALE_PRICE NUMBER(7,2)
    Management has asked you to calculate the net revenue per unit for each product, if the cost of each product is increased by 10% and the sale price of each product is increased by 25%. You issue this SQL statement.
    SELECT id, sale_price * 1.25 cost * 1.10
    FROM product;
    Which conclusion can you draw from the results?
    A) Only the required results are displayed.
    B) The results provide more information than management requested.
    C) A function needs to be included in the SELECT statement to achieve the desired result.
    D) The order on the operations in the calculation needs to be changed to achieve the required results.

    Ans: B
    I consider A this select just gets the desired result. Any comment?
    MCSE/MCDBA, OCP DBA 8i
    Working on SCJP -> SCJD

  2. #2
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    510
    A is correct unless we have to assume that PRODUCT table does not have a PRIMARY KEY and there are many id's for the same product (use distinct) or there are inactive and expired products (use where clause).

    Noting in the question suggests we have to assume all that.
    Remember the Golden Rule - He who has the gold makes the rules!
    ===================
    Kris109
    Ph.D., OCP 8i, 9i, 10g, 11g DBA

  3. #3
    Join Date
    Feb 2002
    Posts
    166
    Thx, so many guys consider B. I had it in my test and missed one basic SQL statement item most likely it is.
    MCSE/MCDBA, OCP DBA 8i
    Working on SCJP -> SCJD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width