nerdexam
Oracle

1Z0-061 · Question #99

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…

The correct answer is C. remove the table alias from the SELECT clause E. prefix the column in the ORDER BY clause with the table alias. 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…

Displaying Data from Multiple Tables using Joins

Question

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?

Options

  • Aremove the ORDER BY clause
  • Bremove the table alias prefix from the WHERE clause
  • Cremove the table alias from the SELECT clause
  • Dprefix the column in the USING clause with the table alias
  • Eprefix the column in the ORDER BY clause with the table alias
  • Freplace the condition

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    15% (4)
  • C
    73% (19)
  • F
    8% (2)

Explanation

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.

Topics

#USING clause#column qualification#JOIN syntax#table alias prefix

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice