Complex Queries Flashcards
The blank operator is used in a WHERE. Pause to determine if a value matches one of several values
IN
Like the IN operator, you can use blank in a WHERE clause to determine if a value doesn’t matches one of several values
NOT IN
The blank provides an alternative to determine if a value is between two other values.
BETWEEN operator
The BETWEEN operator is written how and is equivalent to value >= minValue AND value <=MaxValue
BETWEEN minValue AND maxValue
The BETWEEN operator can or cannot be used with string literals
Can
Which runs faster BETWEEN or other <=>= SQL statements
Neither. Same speed
The blank when used in a WHERE clause matches text against a pattern using wildcard characters blank and blank
LIKE operator
%
_
Blank matches any number of characters when used with LIKE
%
Blank matches only one character when used with LIKE
_
The LIKe operator performs case-blank patterns matching by default or case-blank pattern matching if followed by the blank keyword
Insensitive
Sensitive
BINARY
To search for wildcard characters % or _ a blank must precede them
/
Most relational databases provide other mechanisms to perform advanced pattern matching with blank
Regular expressions
The blank is used in a SELeCT statement to return any unique or distinct values
DISTINCT clause
The DISTINCT clause blank from results
Removes repeated values
Give the syntax for using a distinct clause
SELECT DISTINCT ColumnName
FROM TableName
A blank selects rows from a table with no guarantee the data will come back in a certain order.
SELECT
The blank clause orders selected rows by one or more columns in ascending order.
ORDER BY
The blank keyword with the ORDER BY clause orders rows in descending order
DESC
A blank operates on an expression in parentheses, called a blank, and returns a value.
Function
Argument
Each function operates on, and evaluates to, blank
Specific data types
If the argument is invalid, it returns blank
NULL
Blank returns the absolute value
ABS(n)
Blank returns the natural logarithm of n
LOG(n)
Blank returns x to the power of y
POW(x,y)