Exam Review Flashcards
makes it easier to query fields where data isn’t always sorted in a standard format
case-manipulation functions
3 purposes of column aliases (other than display)
- enhances formatting
- calculated columns
- concatenated columns
does CONCAT allow character strings?
no
____ refer to pattern matching in a search string
wildcards
general function: displays replacement values as specified
DECODE
date function: displays the last day of the month specified
LAST_DAY
4 math operators usable in calculated columns
add, subtract, multiply, divide
3 conversion functions in SQL that allow conversion from one data type to another
- TO_CHAR
- TO_NUMBER
- TO_DATE
can be used to force priority to the expression contained within them
parentheses
t or f. always use the ROUND function for age or years worked
f, always use TRUNC
if the length is not indicated in SUBSTR, oracle assumes ____
to the end of string
NULL means the value is one of these 4 things
- unassigned
- unavailable
- inapplicable
- unknown
order of operations: ___ and ___ are processed prior to ___ and ___
multiplication/division/addition/subtraction
similar to find and replace function in word
REPLACE
for TO_NUMBER dates must be changed into a ____ before applying TO_NUMBER
character string
in NULLIF(expr1, expr2), what is returned if expr1 <> expr2?
expr1 value is returned
t or f. data can be sorted by multiple columns
t
syntax that subtracts a number of days to a date
date - number
in the function ROUND(column, p), what does p stand for?
p = position to which the data should be rounded
dates within the syntax can be a date ___ or a hard-coded date ___
column, value
what do v, r, and d stand for in DECODE(column, v, r, d)
v = value r = replacement value d = default
not in text: a format element for use with dates that prevents zero-padding of numeric elements and extra space when using commas
fm
comparison operator: used to search for values within a specified list of values
IN
comparison operator: used for searches with a ‘wildcard’ when you do not know the exact value
LIKE
an ___ represents one value
underscore (_)
date function: displays the date of the next specified day of the week
NEXT_DAY
for MONTHS_BETWEEN(date 1, date 2): if date 2 is earlier than date 1, the result is ___
positive
t or f. NULL is not zero, nor can it be equal or unequal to any value
t
t or f. in LPAD/RPAD, characters require delimiters while numbers do not
t
negative numbers can be used as p in a SUBSTR function to indicate a start from the ____
end of the string
Functions that accept numeric data and return numeric results
number functions
in LPAD/RPAD function:
LPAD(columnName, l, s) what do l and s stand for?
l = length of character string after padding s = symbol to use as padding
combination of partial data values (characters or numbers, etc) plus one or more wildcards
search strings
for the TRIM function, a ____ from the beginning and/or end of a value must be indicated
character string
in the WHERE clause, single row functions state a ____ or ____ values returned
condition, restrict
general function: returns a null value if 2 expressions are equal
NULLIF
character manipulation function: returns a portion of the data value
SUBSTR
concatenation operator can join data from 2 or more columns with these 3 things
- character string(s)
- constant value
- arithmetic expression
ORDER BY clause can sort by these 3 column elements
column
- name
- alias
- number
comparison operator: used to ensure a value is within the field
IS NOT NULL
comparison operator: opposite of LIKE
NOT LIKE
column number is assigned based on ____ within the ____ clause
column location, SELECT
changes the column name displayed
column alias
t or f. character manipulation functions in the WHERE clause does not change how the information looks
t
conditions that can be in the where clause
columns, expressions, constants and comparison operators
conversion function: converts a character string to a DATE
TO_DATE