Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:SQL Execution Order
Current Quiz Count:30
Progress
0%
Q1
True / False

In Oracle, the SELECT clause is the first clause executed in a SQL query.

Q2
True / False

The WHERE clause in Oracle is used to filter rows before any grouping occurs.

Q3
True / False

In Oracle, the ORDER BY clause is executed last in a SQL query.

Q4
True / False

The GROUP BY clause in Oracle is executed after the WHERE clause but before the SELECT clause.

Q5
True / False

In Oracle, the HAVING clause is used to filter groups after the GROUP BY clause is executed.

Q6
True / False

The FROM clause in Oracle is executed after the SELECT clause.

Q7
True / False

In Oracle, subqueries in the FROM clause are executed after the main query's WHERE clause.

Q8
True / False

In Oracle, the JOIN operations are performed after the FROM clause but before the WHERE clause.

Q9
True / False

In Oracle, the DISTINCT keyword is applied after the SELECT clause has retrieved all rows.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on understanding the correct SQL execution order, which helps in writing optimized and accurate SQL queries.

Q11
Single Choice

In Oracle SQL, which clause is executed first in the SQL execution order?

Q12
Single Choice

What is the correct order of execution in a basic SQL query?

Q13
Single Choice

Which clause is executed last in a SQL query?

Q14
Single Choice

Consider the following Oracle SQL query:Which clause filters the rows before they are sorted?

SQL Code
SELECT employee_id, department_id
FROM employees
WHERE salary > 5000
ORDER BY employee_id;
Q15
Single Choice

In Oracle SQL, which of the following clauses can affect the order of rows in the final output but is not responsible for filtering rows?

Q16
Single Choice

Given the Oracle SQL query:Which clause is executed right after the GROUP BY?

SQL Code
SELECT department_id, SUM(salary)
FROM employees
GROUP BY department_id
HAVING SUM(salary) > 100000;
Q17
Single Choice

What will be the result of the following Oracle SQL query in terms of execution order?

SQL Code
SELECT employee_id, COUNT(*)
FROM employees
WHERE department_id = 10
GROUP BY employee_id
ORDER BY COUNT(*) DESC;
Q18
Single Choice

Consider the following Oracle SQL query:Which of the following steps occurs first during execution?

Q19
Single Choice

In Oracle SQL, when is the SELECT clause executed in the context of the overall query execution order?

Q20
Single Choice

What is the execution order of the following Oracle SQL query?

SQL Code
SELECT department_id, AVG(salary)
FROM employees
WHERE job_id = 'IT_PROG'
GROUP BY department_id
HAVING AVG(salary) > 5000
ORDER BY AVG(salary) DESC;
Q21
Multiple Choice

Which SQL code snippet correctly follows the SQL execution order for filtering data before selecting specific columns?

SQL Code
SELECT first_name, last_name
FROM employees
WHERE department_id = 10
ORDER BY last_name;
Q22
Multiple Choice

Which SQL code snippet correctly follows the SQL execution order for applying aggregate functions after grouping data?

SQL Code
SELECT department_id, COUNT(*) AS num_employees
FROM employees
GROUP BY department_id
HAVING COUNT(*) > 5
ORDER BY department_id;
Q23
Multiple Choice

Which SQL code snippet correctly follows the SQL execution order for combining results from two queries?

SQL Code
SELECT employee_id, first_name
FROM employees
WHERE department_id = 10
UNION ALL
SELECT employee_id, first_name
FROM employees
WHERE department_id = 20
ORDER BY first_name;
Q24
Multiple Choice

Which SQL code snippet correctly follows the SQL execution order for performing a join operation before filtering data?

SQL Code
SELECT e.employee_id, e.first_name, d.department_name
FROM employees e
JOIN departments d ON e.department_id = d.department_id
WHERE e.salary > 5000
ORDER BY e.first_name;
Q25
Multiple Choice

Which SQL code snippet correctly follows the SQL execution order for using subqueries in the SELECT clause?

SQL Code
SELECT e.employee_id, e.first_name,
(SELECT department_name FROM departments d WHERE d.department_id = e.department_id) AS department_name
FROM employees e
WHERE e.salary > 5000
ORDER BY e.first_name;
Q26
Multiple Choice

Which SQL code snippet demonstrates advanced SQL execution order by using a window function after a join operation?

SQL Code
SELECT e.employee_id, e.first_name, d.department_name,
RANK() OVER (PARTITION BY d.department_id ORDER BY e.salary DESC) AS rank
FROM employees e
JOIN departments d ON e.department_id = d.department_id
ORDER BY e.first_name;
Q27
Multiple Choice

Which SQL code snippet demonstrates advanced SQL execution order by using a CTE (Common Table Expression) before performing a join?

SQL Code
WITH DepartmentSalaries AS (
SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id)
SELECT e.employee_id, e.first_name, ds.avg_salary
FROM employees e
JOIN DepartmentSalaries ds ON e.department_id = ds.department_id
ORDER BY e.first_name;
Q28
Multiple Choice

Which SQL code snippet demonstrates certification-level SQL execution order by applying multiple WHERE conditions before a join?

SQL Code
SELECT e.employee_id, e.first_name, d.department_name
FROM employees e
JOIN departments d ON e.department_id = d.department_id
WHERE e.salary > 5000 AND e.hire_date > '01-JAN-2020'
ORDER BY e.first_name;
Q29
Multiple Choice

Which SQL code snippet demonstrates certification-level SQL execution order by using a subquery in the WHERE clause?

SQL Code
SELECT employee_id, first_name
FROM employees
WHERE department_id IN (
SELECT department_id FROM departments WHERE location_id = 1700)
ORDER BY first_name;
Q30
Multiple Choice

Which SQL code snippet demonstrates certification-level SQL execution order by using the GROUP BY clause with a HAVING filter?

SQL Code
SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id
HAVING AVG(salary) > 5000
ORDER BY department_id;