Oracle Database Quiz Questions

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

In Oracle, the UPPER function converts all characters in a string to uppercase.

Q2
True / False

The LOWER function in Oracle converts all characters in a string to lowercase.

Q3
True / False

In Oracle, the LENGTH function returns the number of characters in a string.

Q4
True / False

In Oracle, the SUBSTR function extracts a substring from a string, starting at a specified position and for a specified length.

Q5
True / False

The INSTR function in Oracle returns the position of a specified substring within a string, or zero if the substring is not found.

Q6
True / False

In Oracle, the TRIM function removes leading and trailing spaces from a string.

Q7
True / False

In Oracle, the REPLACE function can be used to replace all occurrences of a substring within a string with another substring.

Q8
True / False

The REGEXP_SUBSTR function in Oracle is used to extract a substring from a string using regular expressions.

Q9
True / False

In Oracle, the CONCAT function can concatenate more than two strings in a single call.

Q10
True / False

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

Q11
Single Choice

Which Oracle SQL function is used to return the length of a string?

Q12
Single Choice

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

SQL Code
SELECT UPPER('oracle') FROM dual;
Q13
Single Choice

Which Oracle SQL function can you use to concatenate two strings?

Q14
Single Choice

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

SQL Code
SELECT SUBSTR('ORACLE SQL', 8, 3) FROM dual;
Q15
Single Choice

Which Oracle SQL function is used to find the position of a substring within a string?

Q16
Single Choice

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

Q17
Single Choice

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

SQL Code
SELECT REPLACE('ORACLE SQL', 'SQL', 'PL/SQL') FROM dual;
Q18
Single Choice

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

SQL Code
SELECT INITCAP('oracle sql functions') FROM dual;
Q19
Single Choice

Which Oracle SQL function can be used to remove leading and trailing spaces from a string?

Q20
Single Choice

What is the result of the following Oracle SQL query?

SQL Code
SELECT REGEXP_REPLACE('Oracle 123 PL/SQL', '[0-9]', '') FROM dual;
Q21
Multiple Choice

Which SQL code snippet uses the `SUBSTR` function to extract the first 3 characters of the employee's first name in Oracle?

SQL Code
SELECT employee_id, first_name, SUBSTR(first_name, 1, 3) AS short_name
FROM employees;

SELECT employee_id, first_name, SUBSTR(first_name, 1, 3) AS short_name
FROM employees;

SELECT employee_id, first_name, SUBSTR(first_name, 1, 3) AS short_name
FROM employees;
Q22
Multiple Choice

Which SQL code snippet uses the `INSTR` function to find the position of the letter 'a' in the employee's first name in Oracle?

SQL Code
SELECT employee_id, first_name, INSTR(first_name, 'a') AS position
FROM employees;

SELECT employee_id, first_name, INSTR(first_name, 'a') AS position
FROM employees;

SELECT employee_id, first_name, INSTR(first_name, 'a') AS position
FROM employees;
Q23
Multiple Choice

Which SQL code snippet uses the `LENGTH` function to determine the length of the employee's last name in Oracle?

SQL Code
SELECT employee_id, last_name, LENGTH(last_name) AS name_length
FROM employees;

SELECT employee_id, last_name, LENGTH(last_name) AS name_length
FROM employees;

SELECT employee_id, last_name, LENGTH(last_name) AS name_length
FROM employees;
Q24
Multiple Choice

Which SQL code snippet uses the `UPPER` function to convert the employee's last name to uppercase in Oracle?

SQL Code
SELECT employee_id, last_name, UPPER(last_name) AS upper_name
FROM employees;

SELECT employee_id, last_name, UPPER(last_name) AS upper_name
FROM employees;

SELECT employee_id, last_name, UPPER(last_name) AS upper_name
FROM employees;
Q25
Multiple Choice

Which SQL code snippet uses the `LOWER` function to convert the department name to lowercase in Oracle?

SQL Code
SELECT department_id, department_name, LOWER(department_name) AS lower_name
FROM departments;

SELECT department_id, department_name, LOWER(department_name) AS lower_name
FROM departments;

SELECT department_id, department_name, LOWER(department_name) AS lower_name
FROM departments;
Q26
Multiple Choice

Which SQL code snippet demonstrates advanced use of the `REPLACE` function to replace all occurrences of 'Inc.' with 'LLC' in the company names in Oracle?

SQL Code
SELECT company_id, company_name, REPLACE(company_name, 'Inc.', 'LLC') AS updated_name
FROM companies;

SELECT company_id, company_name, REPLACE(company_name, 'Inc.', 'LLC') AS updated_name
FROM companies;

SELECT company_id, company_name, REPLACE(company_name, 'Inc.', 'LLC') AS updated_name
FROM companies;
Q27
Multiple Choice

Which SQL code snippet demonstrates advanced use of the `TRIM` function to remove leading and trailing spaces from the product names in Oracle?

SQL Code
SELECT product_id, product_name, TRIM(product_name) AS trimmed_name
FROM products;

SELECT product_id, product_name, TRIM(product_name) AS trimmed_name
FROM products;

SELECT product_id, product_name, TRIM(product_name) AS trimmed_name
FROM products;
Q28
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the `CONCAT` function to concatenate first name and last name with a space in between in Oracle?

SQL Code
SELECT employee_id, first_name, last_name, CONCAT(first_name, ' ', last_name) AS full_name
FROM employees;

SELECT employee_id, first_name, last_name, CONCAT(first_name, ' ', last_name) AS full_name
FROM employees;

SELECT employee_id, first_name, last_name, CONCAT(first_name, ' ', last_name) AS full_name
FROM employees;
Q29
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the `LPAD` function to pad the department names with leading asterisks in Oracle?

SQL Code
SELECT department_id, department_name, LPAD(department_name, 15, '*') AS padded_name
FROM departments;

SELECT department_id, department_name, LPAD(department_name, 15, '*') AS padded_name
FROM departments;

SELECT department_id, department_name, LPAD(department_name, 15, '*') AS padded_name
FROM departments;
Q30
Multiple Choice

Which SQL code snippet demonstrates certification-level use of the `INITCAP` function to capitalize the first letter of each word in the project titles in Oracle?

SQL Code
SELECT project_id, project_title, INITCAP(project_title) AS formatted_title
FROM projects;

SELECT project_id, project_title, INITCAP(project_title) AS formatted_title
FROM projects;

SELECT project_id, project_title, INITCAP(project_title) AS formatted_title
FROM projects;