Quiz: Case and Character Manipulation

Test: Quiz: Case and Character Manipulation

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Section 1

 

1. Which of the following SQL statements would correctly return a song title identified in the database as "All These Years"? Mark for Review

(1) Points

WHERE title CONTAINS 'Years';

WHERE title LIKE LOWER('all these years');

WHERE title IN('All','These','Years');

WHERE title LIKE INITCAP('%all these years'); (*)

 

 

2. Which character manipulation function always returns a numerical value? Mark for Review

(1) Points

TRIM

LPAD

LENGTH (*)

SUBSTR

 

 

3. Identify the output from the following SQL statement:

SELECT RPAD('SQL',6, '*')

FROM DUAL;

Mark for Review

(1) Points

******SQL

***SQL

SQL*** (*)

SQL******

 

 

4. Which query selects the first names of the DJ On Demand clients who have a first name beginning with "A"? Mark for Review

(1) Points

SELECT UPPER(first_name)

FROM d_clients

WHERE first_name LIKE %a%

SELECT UPPER(first_name)

FROM d_clients v

WHERE first_name LIKE '%a%'

SELECT UPPER(first_name)

FROM d_clients

WHERE first_name LIKE 'a%'

SELECT UPPER(first_name)

FROM d_clients

WHERE LOWER(first_name) LIKE 'a%'(*)

 

 

5. Character functions accept character arguments and only return character values. True or False? Mark for Review

(1) Points

True

False (*)

Correct Correct

 

6. What does the following SQL SELECT statement return?

SELECT UPPER( SUBSTR('Database Programming', INSTR('Database Programming','P'),20))

FROM dual;

Mark for Review

(1) Points

Programming

PROGRAMMING (*)

Database

DATABASE

Correct Correct

 

7. Which query would return a user password combining the ID of an employee and the first 4 digits of the last name? Mark for Review

(1) Points

SELECT CONCAT (employee_id, SUBSTR(last_name,4,1))

AS "User Passwords"

FROM employees

SELECT CONCAT (employee_id, INSTR(last_name,4,1))

AS "User Passwords"

FROM employees

SELECT CONCAT (employee_id, INSTR(last_name,1,4))

AS "User Passwords"

FROM employees

SELECT CONCAT (employee_id, SUBSTR(last_name,1,4))

AS "User Passwords"

FROM employees(*)

Correct Correct

 

8. Which of the following are types of SQL functions? (Choose two correct answers.) Mark for Review

(1) Points

(Choose all correct answers)

Multi-Row Functions (*)

Column-Row Functions

Single-Row Functions (*)

Many-to-Many Functions

Correct Correct

 

9. Single row functions may be used in ______, _______ and _______ clauses. (Choose two correct answers.) Mark for Review

(1) Points

(Choose all correct answers)

SELECT, FROM, ALWAYS

FROM, SELECT, ORDERS

WHERE, DECODE, ORDER BY (*)

SELECT, WHERE, ORDER BY (*)

Solution for Test: Quiz: Introduction to The Oracle Academy
Solution for Test: Quiz: Data vs Information
Top