0% found this document useful (0 votes)
156 views

Conversion Function Answers

The document discusses Oracle conversion functions such as TO_NUMBER, TO_CHAR, and TO_DATE. It provides examples of converting between different data types like numbers, characters, and dates. It tests understanding of Oracle conversion functions through a series of multiple choice questions about the values returned when applying various conversion functions to sample inputs like SYSDATE.

Uploaded by

Manjinder Judge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

Conversion Function Answers

The document discusses Oracle conversion functions such as TO_NUMBER, TO_CHAR, and TO_DATE. It provides examples of converting between different data types like numbers, characters, and dates. It tests understanding of Oracle conversion functions through a series of multiple choice questions about the values returned when applying various conversion functions to sample inputs like SYSDATE.

Uploaded by

Manjinder Judge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Conversion Function Answers

https://quizlet.com/subject/oracle-cert/

1. What type of conversion is performed by the following statement?


SELECT LENGTH(3.14285) FROM DUAL; (Choose the best answer.)

a. Explicit conversion
b. Implicit conversion
c. TO_NUMBER function conversion
d. None of the above

2. Choose all correct statements regarding conversion functions. (Choose all that apply.)

a. TO_CHAR may convert date items to character items.


b. TO_DATE may convert character items to date items.
c. TO_CHAR may convert numbers to character items.
d. TO_DATE may convert date items to character items.

3. What value is returned after executing the following statement?


SELECT TO_NUMBER(1234.49, '999999.9') FROM DUAL; (Choose the best answer.)

a. 1234.49
b. 001234.5
c. 1234.5
d. None of the above
Note: TO_NUMBER accepts character and converts it into number.
To_CHAR accepts Number and converts it into character.

4. What value is returned after executing the following statement?


SELECT TO_CHAR(1234.49, '999999.9') FROM DUAL; (Choose the best answer.)

a. 1234.49
b. 001234.5
c. 1234.5
d. None of the above

5. If SYSDATE returns 12-JUL-2009, what is returned by the following statement?


SELECT TO_CHAR(SYSDATE, 'fmMONTH, YEAR') FROM DUAL; (Choose the best
answer.)
a. JUL, 2009
b. JULY, TWO THOUSAND NINE
c. JUL-09
d. None of the above
6. If SYSDATE returns 12-JUL-2009, what is returned by the following statement?
SELECT TO_CHAR(SYSDATE, 'fmDDth MONTH') FROM DUAL; (Choose the best
answer.)

a. 12TH JULY
b. 12th July
c. TWELFTH JULY
d. None of the above
Note : Since DD, MONTH are used. Oracle returns UPPER case output.
If we use dd, month are used then Oracle returns LOWER case output.

7. If SYSDATE returns 12-JUL-2009, what is returned by the following statement?


SELECT TO_CHAR(TO_DATE(TO_CHAR(SYSDATE,'DD'),'DD'),'YEAR') FROM DUAL;
(Choose the best answer.)

a. 2009
b. TWO THOUSAND NINE
c. 12-JUL-2009
d. None of the above

8. What value is returned after executing the following statement?


SELECT NVL2(NULLIF('CODA','SID'),'SPANIEL','TERRIER') FROM DUAL;
(Choose the best answer.)
a. SPANIEL
b. TERRIER
c. NULL
d. None of the above

9. What value is returned after executing the following statement?


SELECT NVL(SUBSTR('AM I NULL',10),'YES I AM') FROM DUAL; (Choose the best
answer.)
a. NO
b. NULL
c. YES I AM
d. None of the above

10. If SYSDATE returns 12-JUL-2009, what is returned by the following statement?


SELECT DECODE(TO_CHAR(SYSDATE,'MM'),'02','TAX DUE','PARTY') FROM DUAL;
(Choose the best answer.)
a. TAX DUE
b. PARTY
c. 02
d. None of the above

You might also like