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)- B13% (3)
- C4% (1)
- D75% (18)
- E8% (2)
Community Discussion
No community discussion yet for this question.