Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OCP Question

Status
Not open for further replies.

BabaAli

IS-IT--Management
Jun 3, 2001
7
CA
Hi all,

I was attempting one of the trial OCP tests. I found following question in it, please read it.

QUESTION

The ITEM table contains these columns:

COST NUMBER(7,2)
RETAIL NUMBER(7,2)

The RETAIL and COST columns must have a value that is greater than zero.

Evaluate these two SQL statements:

1. SELECT retail - (cost(1.25) * .10)
FROM item;

2. SELECT (retail - (cost * 1.25) * .10)
FROM item;

What will be the result?

A Statement 1 will return a lower value than statement 2.
B Statement 1 and Statement 2 will return the same values.
C Statement 1 will return a higher value than statement 2.
D Only one of the statements will execute.

ANS: According to OCP Test correct answer is B.

I've tried this answer, but first statement returns error. Please check it out, and if it corrent answer, please reply back.

Thanx.
 
You are correct. The first statement would require a function called "cost" to execute without error. "D" is the correct answer.

Which highlights a problem with the exams - the "correct" answer is not always correct. Sometimes this is the result of a simple error (as in your example), and sometimes it is because whoever wrote the question/answers has an incorrect concept of how Oracle works.
 
I also believe that the abswer according to OCP Exam is wrong, and the correct answer should be D.
 
I have encountered similar blatant errors in the Couchman book covering the 1st test. I am almost done with this book and will be taking the test next week sometime. It's no big deal when I find one that's wrong that I can easily identify based on my experience, but it worries me because on some of the newer concepts, I'll actually learn from getting the question wrong and seeing what the supposed 'correct' answer was. I hope I'm not learning it the wrong way because this book wasn't edited properly!
 
Oradam -
Hopefully you are using a source that explains why answers are right or wrong. At least then you can see if the explanation actually stands up to what you already know. Otherwise, I think your best bet is to go through the exam and actually try to execute the code to see if it works one way or the other - also, how Oracle actually handles things. This takes more work, but it really is the only way to be absolutely sure.
Platitudes that seem appropriate to this situation include:
- "Trust But Verify"
and
- "An ounce of experimentation is worth a pound of expert opinions"!

Good luck!
 
I know that this posting is old, however I have also encountered numerous errors on the couchman book for 8i pl/sql 1z0-001 exam. For anybody planning on taking this exam, I do not recommend using Couchman (ISBN 0-07-219153-8; Exam 1Z0-001). I emailed couchman about the problems, unfortunately he doesn't answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top