Oracle Database Quiz Questions

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

In Oracle, the AND operator is used to combine multiple conditions, and it returns true only if all conditions are true.

Q2
True / False

In Oracle, the OR operator is used to combine multiple conditions, and it returns true if at least one condition is true.

Q3
True / False

In Oracle, the NOT operator is used to negate a condition, returning true if the condition is false and vice versa.

Q4
True / False

In Oracle, the AND operator has higher precedence than the OR operator.

Q5
True / False

In Oracle, you can use parentheses to override the default precedence of logical operators.

Q6
True / False

In Oracle, the AND and OR operators can be combined in a single WHERE clause to create complex logical expressions.

Q7
True / False

In Oracle, the NOT operator can be used with the IN operator to exclude rows that match a list of values.

Q8
True / False

In Oracle, logical operators can be used in combination with comparison operators to create detailed filtering criteria.

Q9
True / False

In Oracle, logical operators can only be used in the WHERE clause.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on using logical operators effectively, understanding their precedence, and optimizing their performance in SQL queries.

Q11
Single Choice

Which of the following is a logical operator in Oracle SQL?

Q12
Single Choice

In Oracle SQL, what does the OR operator do?

Q13
Single Choice

What is the purpose of the NOT operator in Oracle SQL?

Q14
Single Choice

Consider the following Oracle SQL query:What does this query do?

SQL Code
SELECT * FROM employees WHERE department_id = 10 AND salary > 5000;
Q15
Single Choice

Which of the following Oracle SQL queries returns rows where either the job_id is 'SA_REP' or the department_id is 50?

Q16
Single Choice

What will be the result of the following Oracle SQL query?

SQL Code
SELECT * FROM employees WHERE NOT salary < 3000;
Q17
Single Choice

Given the Oracle SQL query:Which employees will this query return?

SQL Code
SELECT * FROM employees WHERE department_id = 10 OR (department_id = 20 AND salary > 6000);
Q18
Single Choice

What is the result of the following Oracle SQL query?

SQL Code
SELECT * FROM employees WHERE department_id = 30 AND (salary > 4000 OR hire_date < '01-JAN-2010');
Q19
Single Choice

Consider this Oracle SQL query:Which employees will this query return?

SQL Code
SELECT * FROM employees WHERE (department_id = 40 AND job_id = 'IT_PROG') OR (department_id = 50 AND salary > 7000);
Q20
Single Choice

What is the result of the following Oracle SQL query?

SQL Code
SELECT * FROM employees WHERE (department_id = 60 AND salary > 5000) OR (department_id = 70 AND (job_id = 'SA_REP' OR hire_date > '01-JAN-2015'));
Q21
Multiple Choice

Which SQL code snippet uses the 'AND' operator to find employees in the 'Sales' department with a salary greater than $50,000 in Oracle?

SQL Code
SELECT employee_id, first_name, salary
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Sales')
AND salary > 50000;

SELECT employee_id, first_name, salary
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Sales')
AND salary > 50000;

SELECT employee_id, first_name, salary
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Sales')
AND salary > 50000;
Q22
Multiple Choice

Which SQL code snippet uses the 'OR' operator to find employees with a salary greater than $50,000 or who have more than 10 years of experience in Oracle?

SQL Code
SELECT employee_id, first_name, salary, years_of_experience
FROM employees
WHERE salary > 50000 OR years_of_experience > 10;

SELECT employee_id, first_name, salary, years_of_experience
FROM employees
WHERE salary > 50000 OR years_of_experience > 10;

SELECT employee_id, first_name, salary, years_of_experience
FROM employees
WHERE salary > 50000 OR years_of_experience > 10;
Q23
Multiple Choice

Which SQL code snippet uses the 'NOT' operator to find products that are not in the 'Electronics' category in Oracle?

SQL Code
SELECT product_id, product_name, category
FROM products
WHERE category != 'Electronics';

SELECT product_id, product_name, category
FROM products
WHERE category != 'Electronics';

SELECT product_id, product_name, category
FROM products
WHERE category != 'Electronics';
Q24
Multiple Choice

Which SQL code snippet demonstrates the use of 'AND' and 'OR' operators to find orders placed by customers in the 'VIP' category or orders above $1000 in Oracle?

SQL Code
SELECT order_id, customer_id, order_total
FROM orders
WHERE customer_id IN (SELECT customer_id FROM customers WHERE category = 'VIP')
OR order_total > 1000;

SELECT order_id, customer_id, order_total
FROM orders
WHERE customer_id IN (SELECT customer_id FROM customers WHERE category = 'VIP')
OR order_total > 1000;

SELECT order_id, customer_id, order_total
FROM orders
WHERE customer_id IN (SELECT customer_id FROM customers WHERE category = 'VIP')
OR order_total > 1000;
Q25
Multiple Choice

Which SQL code snippet demonstrates the use of 'AND' and 'NOT' operators to find employees in the 'Engineering' department who do not have a manager in Oracle?

SQL Code
SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Engineering')
AND manager_id IS NULL;

SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Engineering')
AND manager_id IS NULL;

SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id = (SELECT department_id FROM departments WHERE department_name = 'Engineering')
AND manager_id IS NULL;
Q26
Multiple Choice

Which SQL code snippet demonstrates advanced use of the 'AND' and 'OR' operators to find products that are either in the 'Electronics' category and priced above $500 or in the 'Furniture' category and priced below $300 in Oracle?

SQL Code
SELECT product_id, product_name, price
FROM products
WHERE (category = 'Electronics' AND price > 500)
OR (category = 'Furniture' AND price < 300);

SELECT product_id, product_name, price
FROM products
WHERE (category = 'Electronics' AND price > 500)
OR (category = 'Furniture' AND price < 300);

SELECT product_id, product_name, price
FROM products
WHERE (category = 'Electronics' AND price > 500)
OR (category = 'Furniture' AND price < 300);
Q27
Multiple Choice

Which SQL code snippet demonstrates advanced use of the 'AND', 'OR', and 'NOT' operators to find customers who are not in the 'VIP' category but have placed orders over $1000 in Oracle?

SQL Code
SELECT customer_id, first_name, last_name
FROM customers
WHERE category != 'VIP'
AND customer_id IN (SELECT customer_id FROM orders WHERE order_total > 1000);

SELECT customer_id, first_name, last_name
FROM customers
WHERE category != 'VIP'
AND customer_id IN (SELECT customer_id FROM orders WHERE order_total > 1000);

SELECT customer_id, first_name, last_name
FROM customers
WHERE category != 'VIP'
AND customer_id IN (SELECT customer_id FROM orders WHERE order_total > 1000);
Q28
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the 'AND' and 'OR' operators to find employees who work in either the 'HR' or 'IT' departments and have a salary above $70,000 in Oracle?

SQL Code
SELECT employee_id, first_name, department_id, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'HR')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'IT'))
AND salary > 70000;

SELECT employee_id, first_name, department_id, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'HR')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'IT'))
AND salary > 70000;

SELECT employee_id, first_name, department_id, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'HR')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'IT'))
AND salary > 70000;
Q29
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the 'NOT' operator combined with 'AND' to exclude certain products from a promotional discount in Oracle?

SQL Code
SELECT product_id, product_name, price
FROM products
WHERE NOT (category = 'Electronics' AND price > 1000);

SELECT product_id, product_name, price
FROM products
WHERE NOT (category = 'Electronics' AND price > 1000);

SELECT product_id, product_name, price
FROM products
WHERE NOT (category = 'Electronics' AND price > 1000);
Q30
Multiple Choice

Which SQL code snippet demonstrates certification-level use of 'AND', 'OR', and 'NOT' operators to filter records based on multiple conditions in Oracle?

SQL Code
SELECT employee_id, first_name, last_name, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'Finance')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'HR'))
AND NOT salary < 50000;

SELECT employee_id, first_name, last_name, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'Finance')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'HR'))
AND NOT salary < 50000;

SELECT employee_id, first_name, last_name, salary
FROM employees
WHERE (department_id = (SELECT department_id FROM departments WHERE department_name = 'Finance')
OR department_id = (SELECT department_id FROM departments WHERE department_name = 'HR'))
AND NOT salary < 50000;