miercuri, 24 februarie 2010

Quiz: Count, Distinct, NVL

Test: Quiz: Count, Distinct, NVL
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1

1. To include null values in the calculations of a group function, you must: Mark for Review
(1) Points


Precede the group function name with NULL


Count the number of null values in that column using COUNT


Convert the null to a value using the NVL( ) function (*)


Group functions can never use null values



Correct Correct


2. Using your existing knowledge of the employees table, would the following two statements produce the same result?

SELECT COUNT(*)
FROM employees;

SELECT COUNT(commission_pct)
FROM employees;
Mark for Review
(1) Points


The first statement is invalid


Yes


No (*)


The second statement is invalid



Correct Correct


3. What would the following SQL statement return?

SELECT COUNT(first_name)
FROM employees;
Mark for Review
(1) Points


A listing of all non-null first names in the employees table


The total number of non-null first names in the employees table (*)


The total number of rows in the employees table


A listing of all unique first names in the employees table



Correct Correct


4. What would the following SQL statement return?

SELECT COUNT(DISTINCT salary)
FROM employees;

Mark for Review
(1) Points


A listing of all unique salaries in the employees table


The total number of rows in the employees table


The total amount of salaries in the employees table


The number of unique salaries in the employees table (*)



Correct Correct


Page 1 of 1 Summary

( Vrei sa traduci ceva?Want to translate something? http://translate.google.ro/# )

2 comentarii: