Subquery inertia
Dan AMar 7 2007 — edited Mar 7 2007Hello
I am preparing for the 1Z0 007 Exam and I have purchased the Self Test Software CD.
My scores are consistently below the pass grade required. I seem to be folding up when it comes to subqueries and / or joins.
I have nearly exhausted the questions available to me on the CD for subqueries, so I wanted to know if anyone here has a useful tutorial / notes for subqueries.
An example of a question I fail on, and still not sure why despite the (helpful) explanations following each question, is this:
" The user needs to retrieve information on employees that have same dpartment id and salary as an employee id that they will enter. You want the query results to include employees that do not have a salary, but not the employee that the user entered"
The answer statement, out of 4 different options, is this:
SELECT * FROM employee
WHERE (department id, NVL (salary, 0)) IN
(SELECT department id, NVL (salary, 0)
FROM employee
WHERE employee_id = &&1)
AND employee_id <> &&1
My issue with this one was why use && (I chose an option that used only one ampersand)
Like I say, the questions are really challenging (for me) compared to those in the Couchman text. One annoying thing is that it isnt possible to copy and paste details from the questions, therefore to represent it again takes either a lot of typing or else a screenshot.
Thanks.
DA