71. Which arithmeticoperations can be performed on a column by using a SQL function that is builtinto
Oracle database (Choose three .)
A. a ddition
B. s ubtraction
C. r aising to a power
D. f inding the quotient
E. f inding the lowestvalue
Answer: ACE
解析:
A选项 sum()
B选项 无
C选项 自乘 power(m,n)
D选项 无
E选项 min()
72. Which tasks can beperformed using SQL functions built into Oracle Database (Choose three.)
A. d isplaying a date ina nondefault format
B. f inding the numberof characters in an expression
C. s ubstituting acharacter string in a text expression with a specified string
D. c ombining more thantwo columns or expressions into a single column in the output
Answer: ABC
解析:
A选项,to_char可以转换多种日期格式,详解见:
http://blog.csdn.net/zbdba/article/details/17042195
B选项,length(char)
C选项,replace(char1,char2,char3)
D选项,无
73. Which tasks can beperformed using SQL functions that are built into Oracle database (Choose
three .)
A. f inding theremainder of a division
B. a dding a number to adate for a resultant date value
C. c omparing twoexpressions to check whether they are equal
D. c hecking whether aspecified character exists in a given string
E. r emoving trailing,leading, and embedded characters from a character string
Answer: ACD
解析:
A选项,mod(m,n)
B选项,无
C选项 : NULLIF(表达式1,表达式2)当两个表达式相等时,返回空;否则返回表达式1。
测试:
scott@ORCL>select nullif(2*3,3*4) from dual;
NULLIF(2*3,3*4)
---------------
6
scott@ORCL>selectnullif(2*3,3*2) from dual;
NULLIF(2*3,3*2)
D选项,instr(char1,char2,[m[n]])
E选项,无
74. Which statements aretrue regarding single row functions (Choose all that apply.)
A. MOD : returns thequotient of a division
B. TRUNC : can be usedwith NUMBER and DATE values
C. CONCAT : can be usedto combine any number of values
D. SYSDATE : returns thedatabase server current date and time
E. INSTR : can be usedto find only the first occurrence of a character in a string
F. TRIM : can be used toremove all the occurrences of a character from a string
Answer: BD
解析:
引用官方文档解释 Single-rowfunctions:
Single-rowfunctions return a single resultrow for every row of a queried table or
view. These functionscan appear in select lists, WHERE clauses, START WITH and
CONNECT BY clauses, andHAVING clauses.
A选项,mod应该是返回余数,而不是商
B选项,引用文档中的一段话:
This function takes as an argument any numeric data type or any nonnumeric data
type that canbe implicitly converted to a numeric data type. If you omit n2, then the
function returns thesame data type as the numeric data type of the argument. If you
include n2, then thefunction returns NUMBER.
C选项,concat(char1,char2)用于连接字符串
D选项,sysdate放回系统当前时间
scott@ORCL>selectsysdate from dual;
SYSDATE
--------------
02-12月-13
E选项,instr(char1,char2,[m[,n]])
The INSTR functionssearch string for substring. The search operation is defined
as comparing thesubstring argument with substrings of string of the same length
for equality until amatch is found or there are no more substrings left. Each
consecutive comparedsubstring of string begins one character to the right (for
forward searches) or onecharacter to the left (for backward searches) from the first
character of theprevious compared substring. If a substring that is equal to
substring is found, thenthe function returns an integer indicating the position of
the first character ofthis substring. If no such substring is found, then the function
returns zero.
SELECT INSTR('CORPORATEFLOOR','OR', 3, 2) "Instring"
FROM DUAL;
Instring
---