Lesson 3 Flashcards
BETWEEN
determines if a value is between two other values
BETWEEN minValue AND maxValue
LIKE
when used in a WHERE clause, matches text against a pattern using the two wildcard character %(percentage symbol) and _(underscore symbol)
ORDER BY
orders selected rows by one or more columns in ascending order
DESC reverses to descending order
function/argument
A function operates on an expression enclosed in parentheses, called an argument, and returns a value
ABS()
returns the absolute value
SELECT ABS(-5); – returns 5
LOWER()
returns lowercase
SELECT LOWER(MySQL); – returns mysql
TRIM()
removes leading and trailing whitespace
SELECT TRIM(‘ hello ‘); – returns ‘hello’
LTRIM removes leading spaces
RTRIM removes traling spaces
HOUR(), MINUTE(), SECOND()
returns hour, minute or second from timestamp
aggregate function
processes values from a set of rows and returns a summary value
COUNT()
count the number of rows
aggregate function
MIN()
finds the minimum value
aggregate function
MAX()
fins the maximum value
aggregate function
SUM()
sums all the values in the set
aggregate function
AVG()
computes the arithmetic mean of all the values
aggregate function
HAVING
used with the GROUPBY clause to filter group results