UNIT 4-6 Flashcards
(93 cards)
returns a four-digit year
YEAR(date_value)
returns a two-digit month code
MONTH(date_value)
returns the number of the day
DAY(date_value)
GETDATE()
SQL SERVER
DATE()
MS ACCESS
___ function produces a date by adding a specified number to a specified part of a date
DATEADD(DATEPART, NUM, DATE) SQL SERVER
DATE_ADD() MYSQL
function returns the difference between two parts of a date
DATEDIFF(datepart, stardate, enddate)
function subtracts a specified time interval from a date.
date_sub(date, interval expr type)
function returns the specified part of the date requested. SQL SERVER
datepart(datepart, date_field)
function is used to return a single part of a date/time, such as year, month, day, hour, minute, etc. MYSQL
EXTRACT(unit from date)
UNIT VALUES
MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR
Returns the current date and time
NOW()
Returns the current date
CURDATE()
Returns the current time
CURTIME()
Returns the current utc date
UTC_DATE()
Returns the current utc time
UTC_TIME()
function rounds numbers to a specified number of decimal places.
ROUND(numeric value, number of decimal places[optional])
operate on values in single rows, one row at a time. A ____“function” can be used to perform an arithmetic operation on a column
Row-level Functions
which returns the next larger integer value when a number contains decimal places.
CEILING()
which returns the next lower integer value when a number contains decimal places.
FLOOR()
which returns the square root of positive numeric values.
SQRT()
which returns the absolute value of any numeric value.
ABS()
which returns a number squared.
SQUARE()
function says that if the expression (or column value) is not null, return the value, but if the value is null, return ValueIfNull. SQL SERVER
ISNULL(expression1, ValueIfNull)
IFNULL()