Q1
True / FalseIn Oracle, the UPPER function converts all characters in a string to uppercase.
The UPPER function takes a string and converts all its characters to uppercase.
Q2
True / FalseThe LOWER function in Oracle converts all characters in a string to lowercase.
The LOWER function converts all characters in a string to lowercase.
Q3
True / FalseIn Oracle, the LENGTH function returns the number of characters in a string.
The LENGTH function returns the length of a string, measured in the number of characters.
Q4
True / FalseIn Oracle, the SUBSTR function extracts a substring from a string, starting at a specified position and for a specified length.
The SUBSTR function extracts a substring from a given string starting at a specified position for a specified length.
Q5
True / FalseThe INSTR function in Oracle returns the position of a specified substring within a string, or zero if the substring is not found.
The INSTR function returns the position of the first occurrence of a specified substring within a string, or zero if it is not found.
Q6
True / FalseIn Oracle, the TRIM function removes leading and trailing spaces from a string.
The TRIM function removes leading and trailing spaces (or other specified characters) from a string.
Q7
True / FalseIn Oracle, the REPLACE function can be used to replace all occurrences of a substring within a string with another substring.
The REPLACE function replaces all occurrences of a specified substring within a string with another substring.
Q8
True / FalseThe REGEXP_SUBSTR function in Oracle is used to extract a substring from a string using regular expressions.
The REGEXP_SUBSTR function extracts a substring from a string based on a regular expression pattern.
Q9
True / FalseIn Oracle, the CONCAT function can concatenate more than two strings in a single call.
The CONCAT function in Oracle can only concatenate two strings at a time. To concatenate more than two strings, multiple CONCAT calls or the || operator must be used.
Q10
True / FalseThe Oracle Certified Professional (OCP) exam includes knowledge on using string functions effectively, understanding their syntax, and optimizing their performance in SQL queries.
The OCP certification covers advanced topics, including the effective use of string functions, understanding their syntax, and optimizing their performance in SQL queries.
Q21
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate the use of the `SUBSTR` function to extract the first 3 characters of the employee's first name. Option D is incorrect because it does not use the `SUBSTR` function.
Q22
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate the use of the `INSTR` function to find the position of the letter 'a' in the employee's first name. Option D is incorrect because it does not use the `INSTR` function.
Q23
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate the use of the `LENGTH` function to determine the length of the employee's last name. Option D is incorrect because it does not use the `LENGTH` function.
Q24
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate the use of the `UPPER` function to convert the employee's last name to uppercase. Option D is incorrect because it does not use the `UPPER` function.
Q25
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate the use of the `LOWER` function to convert the department name to lowercase. Option D is incorrect because it does not use the `LOWER` function.
Q26
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate advanced use of the `REPLACE` function to replace all occurrences of 'Inc.' with 'LLC' in the company names. Option D is incorrect because it does not use the `REPLACE` function.
Q27
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate advanced use of the `TRIM` function to remove leading and trailing spaces from the product names. Option D is incorrect because it does not use the `TRIM` function.
Q28
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate certification-level use of the `CONCAT` function to concatenate first name and last name with a space in between. Option D is incorrect because it does not use the `CONCAT` function.
Q29
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate certification-level use of the `LPAD` function to pad the department names with leading asterisks. Option D is incorrect because it does not use the `LPAD` function.
Q30
Multiple ChoiceWhich 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;
Options A, B, and C correctly demonstrate certification-level use of the `INITCAP` function to capitalize the first letter of each word in the project titles. Option D is incorrect because it does not use the `INITCAP` function.