Exam Review Flashcards

1
Q

makes it easier to query fields where data isn’t always sorted in a standard format

A

case-manipulation functions

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

3 purposes of column aliases (other than display)

A
  1. enhances formatting
  2. calculated columns
  3. concatenated columns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

does CONCAT allow character strings?

A

no

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

____ refer to pattern matching in a search string

A

wildcards

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

general function: displays replacement values as specified

A

DECODE

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

date function: displays the last day of the month specified

A

LAST_DAY

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

4 math operators usable in calculated columns

A

add, subtract, multiply, divide

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

3 conversion functions in SQL that allow conversion from one data type to another

A
  1. TO_CHAR
  2. TO_NUMBER
  3. TO_DATE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

can be used to force priority to the expression contained within them

A

parentheses

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

t or f. always use the ROUND function for age or years worked

A

f, always use TRUNC

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

if the length is not indicated in SUBSTR, oracle assumes ____

A

to the end of string

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

NULL means the value is one of these 4 things

A
  1. unassigned
  2. unavailable
  3. inapplicable
  4. unknown
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

order of operations: ___ and ___ are processed prior to ___ and ___

A

multiplication/division/addition/subtraction

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

similar to find and replace function in word

A

REPLACE

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

for TO_NUMBER dates must be changed into a ____ before applying TO_NUMBER

A

character string

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

in NULLIF(expr1, expr2), what is returned if expr1 <> expr2?

A

expr1 value is returned

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

t or f. data can be sorted by multiple columns

A

t

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

syntax that subtracts a number of days to a date

A

date - number

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

in the function ROUND(column, p), what does p stand for?

A

p = position to which the data should be rounded

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

dates within the syntax can be a date ___ or a hard-coded date ___

A

column, value

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

what do v, r, and d stand for in DECODE(column, v, r, d)

A
v = value
r = replacement value
d = default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

not in text: a format element for use with dates that prevents zero-padding of numeric elements and extra space when using commas

A

fm

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

comparison operator: used to search for values within a specified list of values

A

IN

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

comparison operator: used for searches with a ‘wildcard’ when you do not know the exact value

A

LIKE

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

an ___ represents one value

A

underscore (_)

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

date function: displays the date of the next specified day of the week

A

NEXT_DAY

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

for MONTHS_BETWEEN(date 1, date 2): if date 2 is earlier than date 1, the result is ___

A

positive

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

t or f. NULL is not zero, nor can it be equal or unequal to any value

A

t

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

t or f. in LPAD/RPAD, characters require delimiters while numbers do not

A

t

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

negative numbers can be used as p in a SUBSTR function to indicate a start from the ____

A

end of the string

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

Functions that accept numeric data and return numeric results

A

number functions

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

in LPAD/RPAD function:

LPAD(columnName, l, s) what do l and s stand for?

A
l = length of character string after padding
s = symbol to use as padding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

combination of partial data values (characters or numbers, etc) plus one or more wildcards

A

search strings

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

for the TRIM function, a ____ from the beginning and/or end of a value must be indicated

A

character string

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

in the WHERE clause, single row functions state a ____ or ____ values returned

A

condition, restrict

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

general function: returns a null value if 2 expressions are equal

A

NULLIF

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

character manipulation function: returns a portion of the data value

A

SUBSTR

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

concatenation operator can join data from 2 or more columns with these 3 things

A
  1. character string(s)
  2. constant value
  3. arithmetic expression
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

ORDER BY clause can sort by these 3 column elements

A

column

  1. name
  2. alias
  3. number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

comparison operator: used to ensure a value is within the field

A

IS NOT NULL

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

comparison operator: opposite of LIKE

A

NOT LIKE

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

column number is assigned based on ____ within the ____ clause

A

column location, SELECT

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

changes the column name displayed

A

column alias

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

t or f. character manipulation functions in the WHERE clause does not change how the information looks

A

t

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

conditions that can be in the where clause

A

columns, expressions, constants and comparison operators

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

conversion function: converts a character string to a DATE

A

TO_DATE

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

WHERE clause operator: limits number of rows displayed by a query

A

row restriction

48
Q

character manipulation functions: single-row function that does the same thing as the concatenation pipe

A

CONCAT

49
Q

conversion function: converts a character string with digits to a NUMBER

A

TO_NUMBER

50
Q

when p is positive in the ROUND function, the data is rounded to the __ side of the decimal

A

right

51
Q

used to modify the display of query results

A

character manipulation functions

52
Q

symbols used for column alias

A

” “

53
Q

4 types of columns you can use column aliases on

A
  1. underscored columns
  2. calculated columns
  3. inconsistent case columns
  4. concatenated columns
54
Q

t or f. output matches the alias case

A

t

55
Q

removes a specific string of characters from the beginning or end of a data value

A

TRIM

56
Q

t or f. date, character, and number types can be used with the NVL function, but the data types must match

A

t

57
Q

comparison operator: value within a specific inclusive range

A

BETWEEN…AND

58
Q

clause: can be used to sort rows returned by a query

A

ORDER BY

59
Q

comparison operator: used to check for NULL values in a field

A

IS NULL

60
Q

for NEXT_DAY(date, value), the value in the syntax can be one of these 2 things`

A
  1. a number representing the day (1 for Sun, 2 for Mon…)

2. a character string such as ‘Wednesday’

61
Q

can specify whether to sort ascending or descending

A

ASC or DESC

62
Q

for MONTHS_BETWEEN(date 1, date 2): if date 1 is earlier than date 2, the result is ___

A

negative

63
Q

functions that are used to fill in the area on the left or right of a character string

A

LPAD and RPAD

64
Q

syntax that adds or subtracts a number of hours to a date

A

date +/- numberofhours/24

65
Q

concatenation operator

A

|| also known as a ‘pipe’

66
Q

t or f. TRIM can be used on its own or as LTRIM or RTRIM

A

t

67
Q

in the SELECT clause, single row functions change the ____

A

display

68
Q

in NVL(column, n), n represents the ___

A

replacement value

69
Q

fm only needs to be used in the ____ within one ____

A

first instance, TO_CHAR

70
Q

in the SUBSTR syntax SUBSTR(columnName, p, l), what do p and l stand for?

A
p = starting position
l = length of string returned
71
Q

WHERE ROWNUM or =?

A

<

72
Q

1 constraint for column aliases

A

length

73
Q

math operators can be used in any SQL statement clause except the ____ clause

A

FROM

74
Q

t or f. case does not matter when it comes to search strings

A

f

75
Q

conversion function: converts a NUMBER or DATE to character string (VARCHAR2)

A

TO_CHAR

76
Q

date function: calculates number of months between 2 specified dates

A

MONTHS_BETWEEN

77
Q

syntax that subtracts one date from another and displays results in days

A

date - date

78
Q

t or f. column aliases are a permanent change to the column name

A

f

79
Q

conversion function most often used with TO_CHAR (date) to perform calculations

A

TO_NUMBER

80
Q

column alias change the ____ of the column output

A

output display

81
Q

t or f. the IN condition can be used with any data type (date, number, VARCHAR, etc.)

A

t

82
Q

number function that cuts off number values at the decimal place

A

TRUNC

83
Q

general function: changes display of a null value

A

NVL

84
Q

character manipulation functions: determines the number of characters in a string

A

LENGTH

85
Q

5 single row functions

A
  1. character
  2. number
  3. date
  4. conversion
  5. general
86
Q

‘p’ if you want to round to the whole number

A

0

87
Q

mathematical expressions that can be comprised of column names, constant numeric values and mathematical operators

A

calculated columns

88
Q

useful when the user is uncertain of the case of data values

A

character manipulation functions

89
Q

in CASE, a ___ is necessary

A

column alias

90
Q

3 case manipulation functions

A
  1. LOWER
  2. UPPER
  3. INITCAP
91
Q

clause that contains a condition that must be met

A

WHERE clause

92
Q

the state of being linked together

A

concatenation

93
Q

‘p’ if you want to round to the nearest 10

A

-1

94
Q

fm stands for ____

A

format model

95
Q

comparison operator: value not within specific inclusive range

A

NOT BETWEEN…AND

96
Q

general function: allows various actions to be applied within a single IF-THEN-ELSE logic statement; used extensively in industry

A

CASE

97
Q

in BETWEEN AND, the range contains both an upper and lower limit with the ____ limit specified first

A

lower

98
Q

what are the 5 single-row functions

A
  1. character
  2. number
  3. date
  4. conversion
  5. general
99
Q

by default, the ORDER BY clause will sort in ____ order

A

ascending

100
Q

WHERE clause: if condition is false, rows ____ be returned and if condition is true, rows ____ be returned

A

won’t, will

101
Q

in NULLIF(expr1, expr2), what is returned if expr1 = expr2?

A

null

102
Q

when p is negative in the ROUND function, the data is rounded to the __ side of the decimal

A

left

103
Q

t or f. if used, the ORDER BY clause must be the first clause of the statement

A

f

104
Q

in industry, wildcards are often used with ____

A

diagnosis or intervention codes

105
Q

CONCAT can be used in ____ clause

A

WHERE

106
Q

general function: simpler version of CASE

A

DECODE

107
Q

conversion function used to get around oracle’s default date format (DD-MON-YY)

A

TO_DATE

108
Q

a ___ represents multiple values

A

percentage sign (%)

109
Q

comparison operator: used to search for values not within a specified list of values

A

NOT IN

110
Q

date function: adds a specified number of months to the specified date

A

ADD_MONTHS

111
Q

t or f. all single-row functions can be used in the WHERE clause as well as the SELECT clause

A

t

112
Q

general function: evaluates expression(s) and displays replacement values as specified

A

CASE

113
Q

what can’t be used in the WHERE clause

A

column aliases

114
Q

‘p’ if you want to round to the nearest 10th

A

1

115
Q

a query can have several conditions if ___ or ___ operators are used

A

AND/OR

116
Q

syntax to add a number of days to a date

A

date + number

117
Q

2 most frequently used number functions

A
  1. ROUND

2. TRUNC