Oracle Database Quiz Questions

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

In Oracle, the = operator is used to compare two values for equality.

Q2
True / False

In Oracle, the != and <> operators are both used to compare two values for inequality.

Q3
True / False

In Oracle, the > operator is used to compare two values to determine if the left value is greater than the right value.

Q4
True / False

In Oracle, the <= operator checks if the left value is less than or equal to the right value.

Q5
True / False

In Oracle, the >= operator checks if the left value is greater than or equal to the right value.

Q6
True / False

In Oracle, the LIKE operator is used to compare a value to a pattern using wildcard characters.

Q7
True / False

In Oracle, the BETWEEN operator is used to compare a value to a range of values, including the boundary values.

Q8
True / False

In Oracle, the IN operator is used to compare a value to a list of literal values or the results of a subquery.

Q9
True / False

In Oracle, the IS NULL and IS NOT NULL operators are used to compare values to NULL.

Q10
True / False

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

Q11
Single Choice

Which of the following is a valid comparison operator in Oracle SQL?

Q12
Single Choice

In Oracle SQL, what does the following expression evaluate to?

SQL Code
SELECT 5 > 3 FROM dual;
Q13
Single Choice

Which Oracle SQL operator would you use to check if a value is greater than or equal to another value?

Q14
Single Choice

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

SQL Code
SELECT * FROM employees WHERE salary < 5000;
Q15
Single Choice

Which Oracle SQL operator is used to compare if two values are not equal?

Q16
Single Choice

Given the Oracle SQL query:What will be the result?

SQL Code
SELECT department_id FROM departments WHERE department_id = 10;
Q17
Single Choice

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

SQL Code
SELECT 15 BETWEEN 10 AND 20 FROM dual;
Q18
Single Choice

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

Q19
Single Choice

Which of the following Oracle SQL queries correctly filters rows where the hire_date is before January 1, 2000?

Q20
Single Choice

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

SQL Code
SELECT CASE
 WHEN salary = 5000 THEN 'Exact Match'
 WHEN salary > 5000 THEN 'Above 5000'
 ELSE 'Below 5000'
 END AS salary_status
FROM employees;
Q21
Multiple Choice

Which SQL code snippet uses the '=' operator to find employees in the 'Sales' department in Oracle?

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

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

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

Which SQL code snippet uses the '>' operator to find employees with salaries greater than $50,000 in Oracle?

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

SELECT employee_id, first_name, salary
FROM employees
WHERE salary > 50000;

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

Which SQL code snippet uses the '<' operator to find employees with less than 5 years of experience in Oracle?

SQL Code
SELECT employee_id, first_name, years_of_experience
FROM employees
WHERE years_of_experience < 5;

SELECT employee_id, first_name, years_of_experience
FROM employees
WHERE years_of_experience < 5;

SELECT employee_id, first_name, years_of_experience
FROM employees
WHERE years_of_experience < 5;
Q24
Multiple Choice

Which SQL code snippet uses the '>=' operator to find products with a price greater than or equal to $100 in Oracle?

SQL Code
SELECT product_id, product_name, price
FROM products
WHERE price >= 100;

SELECT product_id, product_name, price
FROM products
WHERE price >= 100;

SELECT product_id, product_name, price
FROM products
WHERE price >= 100;
Q25
Multiple Choice

Which SQL code snippet uses the '<=' operator to find orders placed on or before January 1, 2023, in Oracle?

SQL Code
SELECT order_id, order_date, customer_id
FROM orders
WHERE order_date <= '2023-01-01';

SELECT order_id, order_date, customer_id
FROM orders
WHERE order_date <= '2023-01-01';

SELECT order_id, order_date, customer_id
FROM orders
WHERE order_date <= '2023-01-01';
Q26
Multiple Choice

Which SQL code snippet demonstrates advanced use of the '!=' operator to find employees not in the 'HR' department in Oracle?

SQL Code
SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id != (SELECT department_id
FROM departments
WHERE department_name = 'HR');

SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id != (SELECT department_id
FROM departments
WHERE department_name = 'HR');

SELECT employee_id, first_name, department_id
FROM employees
WHERE department_id != (SELECT department_id
FROM departments
WHERE department_name = 'HR');
Q27
Multiple Choice

Which SQL code snippet demonstrates advanced use of the '<>' operator to find employees whose salary is not equal to $60,000 in Oracle?

SQL Code
SELECT employee_id, first_name, salary
FROM employees
WHERE salary <> 60000;

SELECT employee_id, first_name, salary
FROM employees
WHERE salary <> 60000;

SELECT employee_id, first_name, salary
FROM employees
WHERE salary <> 60000;
Q28
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the 'BETWEEN' operator to find products priced between $50 and $150 in Oracle?

SQL Code
SELECT product_id, product_name, price
FROM products
WHERE price BETWEEN 50 AND 150;

SELECT product_id, product_name, price
FROM products
WHERE price BETWEEN 50 AND 150;

SELECT product_id, product_name, price
FROM products
WHERE price BETWEEN 50 AND 150;
Q29
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the 'IN' operator to find orders placed by specific customers in Oracle?

SQL Code
SELECT order_id, customer_id, order_date
FROM orders
WHERE customer_id IN (101, 102, 103);

SELECT order_id, customer_id, order_date
FROM orders
WHERE customer_id IN (101, 102, 103);

SELECT order_id, customer_id, order_date
FROM orders
WHERE customer_id IN (101, 102, 103);
Q30
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the 'LIKE' operator to find customers whose last name starts with 'S' in Oracle?

SQL Code
SELECT customer_id, first_name, last_name
FROM customers
WHERE last_name LIKE 'S%';

SELECT customer_id, first_name, last_name
FROM customers
WHERE last_name LIKE 'S%';

SELECT customer_id, first_name, last_name
FROM customers
WHERE last_name LIKE 'S%';