chapter 5.2 Flashcards

1
Q

what are nested functions

A

it refers to functions being contained within another function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how are nested functions evaluated

A

evaluation process begins from the innermost level to the outermost level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does the next_day() function do ?

A

The next_day function returns the first day of that month

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

_________ is the value that is unavailable, unassigned, unknown or inapplicable

A

Null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are 4 different functions oracle has that pertain to the use of null values

A

NVL
NVL2
NULLIF
COALESCE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does the NVL function do

A

converts a null value to a known value of a fixed data type, either date, character, or number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

rule of NVL function

A

data types of null value column and the new value must be the same

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

NVL synatax

A

NVL(column with null values, value to substitute for null)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what happens when arithmetic calculation is performed with null

A

result is null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

nvl2 function evaluates the expression with ________ values

A

3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how does NVL2 work

A

if the first values is not null, then the first expression is returned

if the first value is null, then the third expression is returned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are the data type restrictions in NVL2

A

values in expression 1 can have any data type

expression 2 and expression 3 can have any data type except LONG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the data type returned in NVL2

A

The data type of the returned value is always the same as the data type of expression 2, unless expression 2 is character data, in which case the returned type is varchar2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what does the NULLIF function do

A

compares 2 expressions and if they are equal, the function returns null
if they are not equal, the function returns the first expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the coalesce function is extension of _______

A

NVL function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_____ means to come together

A

coalesce

17
Q

what does coalesce do ?

A

Coalesce(expression1, expression2, expression3, …)

18
Q

what does select coalesce(commission_pct, salary, 10) as “comm” return

A

if commission_pct is not null, it is returned
else it will check if salary has a value and return salary.

if commision_pct and salary are null it will return 10