wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Character Functions

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Review this SQL statement:

SELECT SUBSTR('2009',1,2) || LTRIM('1124','1') FROM DUAL;


What will be the result of the SQL statement?

a)

2024

b)

221

c)

20124

d)

A syntax error

2.

UPPER ( LOWER ("HELLO world"))


Output of the above function call is:

a)

HELLO world

b)

hello WORLD

c)

HELLO WORLD

d)

hello world

3.

Output for the following function call is:


SELECT INITCAP('I have just-now reaCHed 7th floor of my home:my destination') from DUAL;

a)

I Have Just-now Reached 7th Floor Of My Home:my Destination

b)

I Have Just-Now Reached 7th Floor Of My Home:My Destination

c)

I Have Just-Now ReaCHed 7Th Floor Of My Home:My Destination

d)

I Have Just-now ReaCHed 7Th Floor Of My Home:my Destination

4.

What will be the output of the following question?


SELECT SUBSTR('I LOVE MY INDIA',3,5) FROM DUAL;

a)

LOVE

b)

VE MY

c)

LOVE M

d)

None of the above

5.

Assuming Database is using a 2 Byte Character Set, What will be the output of the following Query?


SELECT LENGTHB('I AM A NISTIAN') FROM DUAL;

a)

14

b)

28

c)

7

d)

None of the above

6.

What will be the output of the following Query?


SELECT INSTR('NISTIAN ROCKS','i',3,1) FROM DUAL:

a)

0

b)

5

c)

2

d)

None of the above

7.

What is the output for the following query?


SELECT RPAD('INDIAN', 4, '.' ) FROM DUAL;

a)

INDIAN....

b)

....INDIAN

c)

INDI

d)

DIAN

8.

What will be the output of the following query?


SELECT LTRIM('BANDE MATARAM', 'BADM') FROM DUAL;

a)

BANDE MATARAM

b)

NDE MATARAM

c)

NE TR

d)

BANDE MATAR

9.

SELECT REPLACE('EGG FIRST OR HEN','EGH','PT') FROM DUAL

a)

PTG FIRST OR HEN

b)

PTT FIRST OR PN

c)

PTT FIRST OR HPN

d)

ERROR

10.

SELECT SUBSTR('12/11/2019', INSTR('12/11/2019','/',-1,1)+1) FROM DUAL;

a)

2019

b)

019

c)

2020

d)

11/2019