nerdexam
Oracle

1Z0-007 · Question #152

Examine the structure of the EMPLOYEES and DEPARTMENTS tables: Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, Salary FROM employees e, departments d WHERE…

The correct answer is C. SELECT employee_id, d.department_id, department_name. This query shows correct JOIN ON clause syntax and provides equivalent to the above SQL Incorrect Answers A: This statement will show data only for the EMPLOYEES table with records that have department ID from DEPARTMENTS table, not join result of two tables. B: NATURAL join…

Displaying Data from Multiple Tables and Subqueries

Question

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:

Evaluate this SQL statement:

SELECT employee_id, e.department_id, department_name, Salary FROM employees e, departments d WHERE e.department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement?

Exhibit

1Z0-007 question #152 exhibit

Options

  • ASELECT employee_id, department_id, department_name, Salary
  • BSELECT employee_id, department_id, department_name, Salary
  • CSELECT employee_id, d.department_id, department_name,
  • DSELECT employee_id, department_id, department_name,

How the community answered

(37 responses)
  • A
    16% (6)
  • B
    5% (2)
  • C
    76% (28)
  • D
    3% (1)

Explanation

This query shows correct JOIN ON clause syntax and provides equivalent to the above SQL Incorrect Answers A: This statement will show data only for the EMPLOYEES table with records that have department ID from DEPARTMENTS table, not join result of two tables. B: NATURAL join selects rows from the tables that have equal values in all matched columns (same column names). If the columns having the same names have different datatypes, an error D: There is incorrect usage of JOIN clause with USING keyword.

Topics

#NATURAL JOIN#JOIN USING#equijoin equivalence#table alias

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice