Home » Other » Training & Certification » oca certification (merged)
oca certification (merged) [message #538755] Mon, 09 January 2012 05:24 Go to next message
artijadhav
Messages: 7
Registered: January 2012
Junior Member
hello sir,


can you help me with 81st question from the attached pdf...

i think...answer should be C considering the data in both the tables...

isn't it wrong to consider future data and say there can be more than one smith and hence ans is E


kindly reply

[Updated on: Mon, 09 January 2012 05:35] by Moderator

Report message to a moderator

Re: oca certification [message #538757 is a reply to message #538755] Mon, 09 January 2012 05:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Many of us can't or don't want to download files, so post them inline in text mode and post them formatted.

Regards
Michel




Edit: I see a moderator removed the file, I don't know what it was but do not post copyrighted materials.
Anyway, it is better to post the question in the post, provide your answer and on what it is based.



[Updated on: Mon, 09 January 2012 05:38]

Report message to a moderator

Re: oca certification [message #538758 is a reply to message #538755] Mon, 09 January 2012 05:37 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I have removed your attachment - it looks like copyright material, and such things must not be uploaded to this forum. If I am wrong, please PM me.
John.
oca doubt [message #538765 is a reply to message #538755] Mon, 09 January 2012 06:18 Go to previous messageGo to next message
artijadhav
Messages: 7
Registered: January 2012
Junior Member
i think the answer to the following question is C considering the data given in both of the tables specified in the question...isn't it wrong to consider future data and say answer is E?

Examine the data from the ORDERS and CUSTOMERS tables.
ORDERS
ORD_ID   ORD_DATE   CUST_ID   ORD_TOTAƖ
100   12-JAN-2000   15   10000
101   09-MAR-2000   40   8000
102   09-MAR-2000   35   12500
103   15-MAR-2000   15   12000
104   25-JUN-2000   15   6000
105   18-JUL-2000   20   5000
106   18-JUL-2000   35   7000
107   21-JUL-2000   20   6500
109   04-AUG-2000   10   8000
CUSTOMERS
CUST_ID   CUST_NAME   CITY
10       Smith          Los Angeles
15       Bob            San Francisco
20       Martin         Chicago
25       Mary            New York
30       Rina            Chicago
35       Smith          New York
40       Lind           New York
Evaluate the SQL statement:
SELECT *
FROM orders
WHERE cust_id = (SELECT cust_id
FROM customers
WHERE cust_name = 'Smith');
What is the result when the query is executed?
A.
ORD_ID   ORD_DATE   CUST_ID   ORD_TOTAL
102   09-MAR-2000   35   12500
106   18-JUL-2000   35   7000
108   04-AUG-2000   10   8000
B.
ORD_ID   ORD_DATE   CUST_ID   ORD_TOTAL
102   09-MAR-2000   35   12500
106   18-JUL-2000   35   7000
C.
ORD_ID   ORD_DATE   CUST_ID   ORD_TOTAL
108   04-AUG-2000   10   8000
D. The query fails because the subquery returns more than one row.
E. The query fails because the outer query and the inner query are using different tables.

Answer: D
Explanation:
The query fails because the sub-query returns more than one row: it is possible situation when there are some
customers with name Smith




kindly reply

[update: I've added [code] tags, makes it a bit (not much!) easier to read. jw.]

[Updated on: Mon, 09 January 2012 07:42] by Moderator

Report message to a moderator

Re: oca doubt [message #538770 is a reply to message #538765] Mon, 09 January 2012 06:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel

[Updated on: Mon, 09 January 2012 06:31]

Report message to a moderator

Re: oca doubt [message #538778 is a reply to message #538770] Mon, 09 January 2012 06:58 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
What future data?
Why don't you think D is correct?
Re: oca doubt [message #538787 is a reply to message #538778] Mon, 09 January 2012 07:27 Go to previous message
artijadhav
Messages: 7
Registered: January 2012
Junior Member
oh Sad ok.....i missed out one tupple for smith...i thought there is only on smith with cust_id 10

sorry to trouble u sir
Previous Topic: attend interviews
Next Topic: oca doubt
Goto Forum:
  


Current Time: Fri Mar 29 10:50:03 CDT 2024