What is another way to write the following SQL statement by using another function?
select empno || lpad(initcap(ename), 40-length(empno),'.') "Employee Directory" from emp;
Answer: You can rewrite the statement using the CONCAT function:
select concat(empno, lpad(initcap(ename), 40-length(empno),'.') "Employee Directory" from emp;
Which function would you use to perform an explicit conversion from a number to a string?
Answer: You can use the TO_CHAR function to convert a number to a string.
How can you rewrite the function call NUMTOYMINTERVAL(17, 'year') using the function TO_YMINTERVAL?
Answer: You can rewrite the function call as TO_YMINTERVAL('17-00').
What is the result of a number added to a NULL value?
Answer: The result of a number added to a NULL is NULL.
What is the result of formatting the number −232.6 using the format mask '9999.99S'?
Answer: The resulting format is 232.60-.
Rank the following operators or conditionals based on priority, from highest to lowest: *, OR, ||, >=
Answer: *, ||, >=, OR
The DUAL table has how many rows and how many columns?
Answer: The DUAL table has one row and one column. The column is named DUMMY and has a value of 'X'.
True or false: Strings and numbers can be concatenated.
Answer: True, before the number is concatenated with the string, it is implicitly converted to a string.
Write a SELECT statement with a built-in function or functions that will format the string 'Queen' with the '!' character padded for a total of 20 characters on the left side and with the '?' character padded for a total of 30 characters on the right. (Hint: Use nested functions.)
Answer: SELECT statement:
select rpad(lpad('Queen',20,'!'),30,'?') from dual; RPAD(LPAD('QUEEN',20,'!'),30,' ------------------------------ !!!!!!!!!!!!!!!Queen??????????
What functionality does the Oracle TIMESTAMP datatype have over the DATE datatype?
Answer: The TIMESTAMP datatype stores the time in seconds to up to nine digits of precision.