keywords dt func in sql
keywords dt func in sql
ALL Returns true if all of the subquery values meet the condition
ALTER Adds, deletes, or modifies columns in a table, or changes the data type of a column in a table
ANY Returns true if any of the subquery values meet the condition
CHECK A constraint that limits the value that can be placed in a column
CREATE VIEW Creates a view based on the result set of a SELECT statement
FOREIGN KEY A constraint that is a key used to link two tables together
FULL OUTER JOIN Returns all rows when there is a match in either left table or right table
GROUP BY Groups the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG)
INNER JOIN Returns rows that have matching values in both tables
INSERT INTO Copies data from one table into another table
SELECT
LEFT JOIN Returns all rows from the left table, and the matching rows from the right table
NOT NULL A constraint that enforces a column to not accept NULL values
OUTER JOIN Returns all rows when there is a match in either left table or right table
PRIMARY KEY A constraint that uniquely identifies each record in a database table
RIGHT JOIN Returns all rows from the right table, and the matching rows from the left table
SELECT INTO Copies data from one table into a new table
SELECT TOP Specifies the number of records to return in the result set
SET Specifies which columns and values that should be updated in a table
TABLE Creates a table, or adds, deletes, or modifies columns in a table, or deletes a table or data inside a table
TRUNCATE TABLE Deletes the data inside a table, but not the table itself
UNION Combines the result set of two or more SELECT statements (only distinct values)
UNION ALL Combines the result set of two or more SELECT statements (allows duplicate values)
UNIQUE A constraint that ensures that all values in a column are unique
UPDATE Updates existing rows in a table
WHERE Filters a result set to include only records that fulfill a specified condition
MySQL Functions
MySQL has many built-in functions.
This contains string, numeric, date, and some advanced functions in MySQL.
FORMAT Formats a number to a format like "#,###,###.##", rounded to a specified number of decim
INSERT Inserts a string within a string at the specified position and for a certain number of characte
INSTR Returns the position of the first occurrence of a string in another string
REPLACE Replaces all occurrences of a substring within a string, with a new substring
LOG Returns the natural logarithm of a number, or the logarithm of a number to a specified base
POW Returns the value of a number raised to the power of another number
POWER Returns the value of a number raised to the power of another number
ADDDATE Adds a time/date interval to a date and then returns the date
ADDTIME Adds a time interval to a time/datetime and then returns the time/datetime
DATE_ADD Adds a time/date interval to a date and then returns the date
DATE_SUB Subtracts a time/date interval from a date and then returns the date
LAST_DAY Extracts the last day of the month for a given date
LOCALTIME Returns the current date and time
MAKEDATE Creates and returns a date based on a year and a number of days value
MAKETIME Creates and returns a time based on an hour, minute, and second value
QUARTER Returns the quarter of the year for a given date value
SUBDATE Subtracts a time/date interval from a date and then returns the date
SUBTIME Subtracts a time interval from a datetime and then returns the time/datetime
TO_DAYS Returns the number of days between a date and date "0000-00-00"
YEARWEEK Returns the year and week number for a given date
Function Description
CASE Goes through conditions and return a value when the first condition is met
IFNULL Return a specified value if the expression is NULL, otherwise return the expression
LAST_INSERT_ID Returns the AUTO_INCREMENT id of the last row that has been inserted in a table
NULLIF Compares two expressions and returns NULL if they are equal. Otherwise, the first expression is
SESSION_USER Returns the current MySQL user name and host name
SYSTEM_USER Returns the current MySQL user name and host name
USER Returns the current MySQL user name and host name