单项选择题
Examine the description of the EMPLOYEES table:
Which statement produces the number of different departments that have employees with last name Smith?()
A.SELECT COUNT(*) FROM employees WHERE last_name='Smith';
B.SELECT COUNT(dept_id) FROM employees WHERE last_name='Smith';
C.SELECT DISTINCT(COUNT(dept_id)) FROM employees WHERE last_name='Smith';
D.SELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith';
E.SELECT UNIQUE(dept_id) FROM employees WHERE last_name='Smith';
相关考题
-
单项选择题
Which SELECT statement should you use to extract the year from the system date and display it in the format "1998"?()
A.SELECT TO_CHAR(SYSDATE,'yyyy') FROM dual;
B.SELECT TO_DATE(SYSDATE,'yyyy') FROM dual;
C.SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM dual;
D.SELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM dual;
E.SELECT TO_CHAR(SUBSTR(SYSDATE, 8,2),'yyyy') FROM dual; -
单项选择题
In which scenario would an index be most useful?()
A.The indexed column is declared as NOT NULL.
B.The indexed columns are used in the FROM clause.
C.The indexed columns are part of an expression.
D.The indexed column contains a wide range of values. -
单项选择题
Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary , hire_date FROM EMPLOYEESORDER BY 2 DESC; What is true about them?()
A.The two statements produce identical results.
B.The second statement returns a syntax error.
C.There is no need to specify DESC because the results are sorted in descending order by default.
D.The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.
