nerdexam
Oracle

1Z0-061 · Question #227

Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) Which statement produces the number of different…

The correct answer is D. SELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith'. See the full explanation below for the reasoning.

Question

Examine the description of the EMPLOYEES table:

EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) Which statement produces the number of different departments that have employees with last name Smith?

Options

  • ASELECT COUNT(*) FROM employees WHERE last_name='Smith';
  • BSELECT COUNT (dept_id) FROM employees WHERE last_name='Smith';
  • CSELECT DISTINCT(COUNT(dept_id)) FROM employees WHERE last_name='Smith';
  • DSELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith';
  • ESELECT UNIQUE(dept_id) FROM employees WHERE last_name='Smith';

How the community answered

(24 responses)
  • B
    13% (3)
  • C
    4% (1)
  • D
    75% (18)
  • E
    8% (2)

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice