Test: Quiz: Subqueries

Section 1

1. What will the following statement return:

SELECT employee_id, last_name

FROM employees

WHERE salary =

(SELECT MIN(salary)

FROM employees

GROUP BY department_id);

Mark for Review

(1) Points

Nothing. It is an invalid statement. (*)

A list of last_names and salaries of employees

A list of first_names and salaries of employees in Department 50

A list of last_names and salaries of employees grouped by department_id.

 

2. What will the following statement return:

SELECT last_name, salary

FROM employees

WHERE salary < (SELECT salary FROM employees WHERE employee_id = 103) Mark for Review (1) Points

A list of last_names and salaries of employees that makes more than employee 103

A list of last_names and salaries of employees that makes less than employee 103 (*)

A list of first_names and salaries of employees making less than employee 103 Nothing. It is an invalid statement.

 

3. What will the following statement return: SELECT last_name, salary FROM employees WHERE (department_id, job_id) IN (SELECT (department_id, job_id) FROM employees WHERE employee_id = 103) Mark for Review (1) Points

A list of last_names and salaries of employees that works in the same department and has the same job_id as that of employee 103. (*)

A list of last_names or salaries of employees that works in the same department and has the same job_id as that of employee 103.

A list of last_names and salaries of employees that works in the same department or has the same job_id as that of employee 103. Nothing. It is an invalid statement.

 

4. Which of the following statements is a true guideline for using subqueries? Mark for Review (1) Points Do not enclose the subquery in parentheses. Place the subquery on the left side of the comparison condition.

The outer and inner queries can reference more than one table. They can get data from different tables. (*)

Only one WHERE clause can be used for a SELECT statement, and if specified, it must be the outer query.

 

5. Subqueries can only be placed in the WHERE clause. True or False? Mark for Review (1) Points

True

False (*)

 

6. Examine the following statement: SELECT last_name, salary FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE employee_id = 103) AND job_id = (SELECT job_id FROM employees WHERE employee_id = 103) Is this a pair-wise or non-pair-wise Subquery? Mark for Review (1) Points

This is an example of a non-pair-wise subquery. (*)

This is an example of a pair-wise subquery. Neither. This statement is illegal, and will not run.

 

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