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

 

5. Given the following data in the employees table (employee_id, salary, commission_pct)
DATA: (143, 2600, null 
144, 2500, null 
149, 10500, .2 
174, 11000, .3 
176, 8600, .2 
178, 7000, .15) 

What is the result of the following statement: 
SELECT SUM(commission_pct), COUNT(commission_pct) 
FROM employees 
WHERE employee_id IN( 143,144,149,174,176,178) 
Mark for Review 
(1) Points 
SUM = .85 and COUNT = 6 
SUM = 1.85 and COUNT = 6 
SUM = .85 and COUNT = 4 (*) 
SUM = 1.85 and COUNT = 4 
 

 

Solution for Test: Quiz: Introduction to The Oracle Academy
Solution for Test: Quiz: Data vs Information
Top