Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: OCP Certification

Re: OCP Certification

From: NicK <nospam_at_emirates.net.ae>
Date: Thu, 25 Dec 2003 15:36:12 +1400
Message-ID: <bseitg$dpt8@news.emirates.net.ae>


Michael J. Moore wrote:
>>My favourite one:
>>Consider the following query:
>> SELECT Item_no FROM Item
>> WHERE Expiry_date = (SELECT Order_date FROM Order
>> WHERE Item_no = 2)
>>Which of the above is true?
>>A. The subguery will return the Order dates for item no 2 outer query.
>>B. The subquery will return an error
>>C. The outer query will return the item no for those items whose expiry
>>date is the same as the order date for item 2.
>>D. The outer query will return an error.
>>Authors said answers A and D are correct.

Actually, the question is correct. The error is that the Order table will contain more than one row with Item_no=2 therefore you cannot use the "=" operator - you have to use the "IN" operator.

BTW, it shouldnt be "Which of the above is true" - it should be "Which of the following is true". And the author is correct - option "A" and "D" are true. Received on Wed Dec 24 2003 - 19:36:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US