oca certification (merged) [message #538755] |
Mon, 09 January 2012 05:24 |
|
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 |
|
Michel Cadot
Messages: 68731 Registered: March 2007 Location: Saint-Maur, France, https...
|
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 |
John Watson
Messages: 8963 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 |
|
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
|
|
|
|
|
|