exam questions

Exam 1z0-061 All Questions

View all questions & answers for the 1z0-061 exam

Exam 1z0-061 topic 2 question 19 discussion

Actual exam question from Oracle's 1z0-061
Question #: 19
Topic #: 2
[All 1z0-061 Questions]

Evaluate this SQL statement:

SELECT e.emp_name, d.dept_name -

FROM employees e -

JOIN departments d -
USING (department_id)
WHERE d.department_id NOT IN (10, 40)
ORDER BY dept_name;
The statement fails when executed. Which change fixes the error?

  • A. remove the ORDER BY clause
  • B. remove the table alias prefix from the WHERE clause
  • C. remove the table alias from the SELECT clause
  • D. prefix the column in the USING clause with the table alias
  • E. prefix the column in the ORDER BY clause with the table alias
  • F. replace the condition "d.department_id NOT IN (10, 40)" in the WHERE clause with "d.department_id <> 10 AND d.department_id <> 40"
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️
Prefix the column in the ORDER BY Clause would cause the statement to succeed, assuming that the statement failed because the dept_name existed in employee & department tables.
Not C: Removing the alias from the columns in the SELECT clause would cause the Statement to fail if the columns existing in both tables.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hggz
5 years, 3 months ago
B is correct. When you’re using the NATURAL JOIN or JOIN USING syntax, you can’t use alias or table names to qualify the column names on the columns used in the join operation anywhere in the query.
upvoted 1 times
...
luizyto
5 years, 3 months ago
Is only B. Alias can't be used in where clause.
upvoted 2 times
...
Sugar
5 years, 4 months ago
ONLY E is the correct answer. this is very basic
upvoted 1 times
...
cnyce
5 years, 7 months ago
B is the correct answer...can we get this updated please?
upvoted 2 times
...
sachin
5 years, 8 months ago
The answer should be B B. remove the table alias prefix from the WHERE clause Rest all is not needed to done.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago