Oracle
1Z0-007 · Question #66
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
(45 responses)- A4% (2)
- B9% (4)
- C2% (1)
- D84% (38)
Community Discussion
No community discussion yet for this question.