column types
functions
string functions
string comparison functions
mathematical functions
date and time functions
privilege types
statements
ALTER TABLE
CREATE DATABASE
CREATE TABLE
DELETE
DESCRIBE
DROP DATABASE
DROP TABLE
INSERT
GRANT
LOAD DATA INFILE
RENAME
REVOKE
SELECT
SHOW
UPDATE
USE

column types
numeric types :
TINYINT[(M)] [UNSIGNED] [ZEROFILL]                -128 to                 127 | 0 to                  255
BIT  A synonym for TINYINT(1).
BOOL A synonym for TINYINT(1).
SMALLINT[(M)] [UNSIGNED] [ZEROFILL]            - 32768 to               32767 | 0 to                65535
MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]          -8388608 to             8388607 | 0 to             16777215
INT[(M)] [UNSIGNED] [ZEROFILL]             -2147483648 to          2147483647 | 0 to           4294967295
INTEGER[(M)] [UNSIGNED] [ZEROFILL]
BIGINT[(M)] [UNSIGNED] [ZEROFILL] -9223372036854775808 to 9223372036854775807 | 0 to 18446744073709551615
FLOAT(precision) [UNSIGNED] [ZEROFILL]
FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]
       -3.402823466E+38  to        -1.175494351E-38  |        1.175494351E-38  to        3.402823466E+38
DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]
-1.7976931348623157E+308 to -2.2250738585072014E-308 | 2.2250738585072014E-308 to 1.7976931348623157E+308
DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL] A synonym for DOUBLE.
REAL[(M,D)] [UNSIGNED] [ZEROFILL]             A synonym for DOUBLE.
DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
DEC[(M[,D])] [UNSIGNED] [ZEROFILL]     A synonym for DECIMAL.
NUMERIC[(M[,D])] [UNSIGNED] [ZEROFILL] A synonym for DECIMAL.
date and time types :
DATE     'YYYY-MM-DD'          | '1000-01-01'          to '9999-12-31'.
DATETIME 'YYYY-MM-DD HH:MM:SS' | '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
TIMESTAMP[(M)] YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD, or YYMMDD format,
depending on whether M is 14 (or missing), 12, 8, or 6
The range is '1970-01-01 00:00:00' to sometime in the year 2037.
TIME                'HH:MM:SS' |          '-838:59:59' to           '838:59:59'.
YEAR[(2|4)] 1901 to 2155(4-digit) | 70 to 69(2-digit)
string (character) types :
[NATIONAL] CHAR(M) [BINARY]    The range of M is 0 to 255.
CHAR                           A synonym for CHAR(1)
[NATIONAL] VARCHAR(M) [BINARY] The range of M is 0 to 255.
TINYBLOB                       maximum length :        255 (2^8  - 1)
TINYTEXT                       maximum length :        255 (2^8  - 1)
BLOB                           maximum length :      65535 (2^16 - 1)
TEXT                           maximum length :      65535 (2^16 - 1)
MEDIUMBLOB                     maximum length :   16777215 (2^24 - 1)
MEDIUMTEXT                     maximum length :   16777215 (2^24 - 1)
LONGBLOB                       maximum length : 4294967295 (2^32 - 1)
LONGTEXT                       maximum length : 4294967295 (2^32 - 1)
ENUM('value1','value2',...)    Can have a maximum of 65535 distinct values.
SET('value1','value2',...)     Can have a maximum of 64 members.


functions
string functions :
ASCII(str)
    Returns the ASCII code value of the leftmost character of the string str.
BIN(N)
    Returns a string representation of the binary value of N, where N is a longlong (BIGINT) number.
BIT_LENGTH(str)
    Returns the length of the string str in bits.
CHAR(N,...)
    CHAR() interprets the arguments as integers
    and returns a string consisting of the characters given by the ASCII code values of those integers.
CHAR_LENGTH(str)
CHARACTER_LENGTH(str)
CONCAT(str1,str2,...)
    Returns the string that results from concatenating the arguments.
CONCAT_WS(separator, str1, str2,...)
    stands for CONCAT With Separator and is a special form of CONCAT().
CONV(N,from_base,to_base)
    Returns a string representation of the number N, converted from base from_base to base to_base.
ELT(N,str1,str2,str3,...)
    Returns str1 if N = 1, str2 if N = 2, and so on.
EXPORT_SET(bits,on,off,[separator,[number_of_bits]])
    Returns a string where for every bit set in 'bit',
    you get an 'on' string and for every reset bit you get an 'off' string.
    Each string is separated with 'separator' (default ',')
    and only 'number_of_bits' (default 64) of 'bits' is used.
FIELD(str,str1,str2,str3,...)
    Returns the index of str in the str1, str2, str3, ... list.
FIND_IN_SET(str,strlist)
    Returns a value 1 to N if the string str is in the list strlist consisting of N substrings.
HEX(N_or_S)
    If N_OR_S is a number, returns a string representation of the hexadecimal value of N,
    where N is a longlong (BIGINT) number.
    This is equivalent to CONV(N,10,16).
    If N_OR_S is a string, returns a hexadecimal string of N_OR_S
    where each character in N_OR_S is converted to 2 hexadecimal digits.
INSERT(str,pos,len,newstr)
    Returns the string str,
    with the substring beginning at position pos and len characters long replaced by the string newstr.
INSTR(str,substr)
    Returns the position of the first occurrence of substring substr in string str.
LCASE(str)
    Returns the string str with all characters changed to lowercase
    according to the current character set mapping (the default is ISO-8859-1 Latin1).
LEFT(str,len)
    Returns the leftmost len characters from the string str.
LENGTH(str)
    Returns the length of the string str.
LOCATE(substr,str[,pos])
    Returns the position of the first occurrence of substring substr in string str, starting at position pos.
LPAD(str,len,padstr)
    Returns the string str, left-padded with the string padstr until str is len characters long.
LOAD_FILE(file_name)
    Reads the file and returns the file contents as a string.
LOWER(str)
    Returns the string str with all characters changed to lowercase
    according to the current character set mapping (the default is ISO-8859-1 Latin1).
LTRIM(str)
    Returns the string str with leading space characters removed.
MAKE_SET(bits,str1,str2,...)
    Returns a set (a string containing substrings separated by `,' characters)
    consisting of the strings that have the corresponding bit in bits set.
MID(str,pos,len)
    Returns a substring len characters long from string str, starting at position pos.
OCT(N)
    Returns a string representation of the octal value of N, where N is a longlong number.
OCTET_LENGTH(str)
ORD(str)
    If the leftmost character of the string str is a multi-byte character,
    returns the code for that character,
    calculated from the ASCII code values of its constituent characters using this formula:
    ((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...].
    If the leftmost character is not a multi-byte character,
    returns the same value that the ASCII() function does.
POSITION(substr IN str)
    Returns the position of the first occurrence of substring substr in string str.
QUOTE(str)
    Quotes a string to produce a result that can be used as a properly-escaped data value in a SQL statement.
REPEAT(str,count)
    Returns a string consisting of the string str repeated count times.
REPLACE(str,from_str,to_str)
    Returns the string str with all all occurrences of the string from_str replaced by the string to_str.
REVERSE(str)
    Returns the string str with the order of the characters reversed.
RIGHT(str,len)
    Returns the rightmost len characters from the string str.
RPAD(str,len,padstr)
    Returns the string str, right-padded with the string padstr until str is len characters long.
RTRIM(str)
    Returns the string str with trailing space characters removed.
SOUNDEX(str)
    Returns a soundex string from str.
SPACE(N)
    Returns a string consisting of N space characters.
SUBSTRING(str,pos[,len])
    Returns a substring len characters long from string str, starting at position pos.
SUBSTRING(str FROM pos[ FOR len])
    Returns a substring len characters long from string str, starting at position pos.
SUBSTRING_INDEX(str,delim,count)
    Returns the substring from string str before count occurrences of the delimiter delim.
TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)
    Returns the string str with all remstr prefixes and/or suffixes removed.
UCASE(str)
    Returns the string str with all characters changed to uppercase
    according to the current character set mapping (the default is ISO-8859-1 Latin1).
UPPER(str)
    Returns the string str with all characters changed to uppercase
    according to the current character set mapping (the default is ISO-8859-1 Latin1).

string comparison functions :
expr [NOT] LIKE [BINARY] pat [ESCAPE 'escape-char']
    Pattern matching using SQL simple regular expression comparison.
    Two wildcard characters in the pattern are '%' and '_'.
MATCH (col1,col2,...) AGAINST (expr[ IN BOOLEAN MODE])
    used for full-text search and returns relevance
    - similarity measure between the text in columns (col1,col2,...) and the query expr.
expr [NOT] REGEXP pat
    Performs a pattern match of a string expression expr against a pattern pat.
    The pattern can be an extended regular expression.
expr [NOT] RLIKE pat
    Performs a pattern match of a string expression expr against a pattern pat.
    The pattern can be an extended regular expression.
STRCMP(expr1,expr2)
    Returns 0 if the strings are the same,
    -1 if the first argument is smaller than the second according to the current sort order, and 1 otherwise.

mathematical functions :
ABS(X) 
    Returns the absolute value of X.
ACOS(X) 
    Returns the arc cosine of X, that is, the value whose cosine is X.
    Returns NULL if X is not in the range -1 to 1.
ASIN(X) 
    Returns the arc sine of X, that is, the value whose sine is X.
    Returns NULL if X is not in the range -1 to 1.
ATAN([Y,]X) ATAN2(Y,X) 
    For the single argument, returns the arc tangent of X, that is, the value whose tangent is X.
    For the two arguments, returns the arc tangent of the two variables X and Y.
CEILING(X) 
    Returns the smallest integer value not less than X.
COS(X) 
    Returns the cosine of X, where X is given in radians.
COT(X) 
    Returns the cotangent of X.
DEGREES(X) 
    Returns the argument X, converted from radians to degrees.
EXP(X) 
    Returns the value of e (the base of natural logarithms) raised to the power of X.
FLOOR(X) 
    Returns the largest integer value not greater than X.
GREATEST(X,Y[,...]) 
    Returns the largest (maximum-valued) argument.
LEAST(X,Y[,...]) 
    With two or more arguments, returns the smallest (minimum-valued) argument.
LOG([B,]X)
    Returns the logarithm of X for an arbitary base B.
LOG2(X) 
    Returns the base-2 logarithm of X.
LN(X) 
    Returns the natural logarithm of X.
MOD(N,M) 
    % 
    Returns the remainder of N divided by M.
PI() 
    Returns the value of PI.
POW(X,Y) 
    Returns the value of X raised to the power of Y.
POWER(X,Y) 
    Returns the value of X raised to the power of Y.
RADIANS(X) 
    Returns the argument X, converted from degrees to radians.
RAND([N]) 
    Returns a random floating-point value in the range 0 to 1.0.
    If an integer argument N is specified, it is used as the seed value.
ROUND(X[,D]) 
    Returns the argument X, rounded to a number with D decimals.
SIGN(X) 
    Returns the sign of the argument as -1, 0, or 1,
    depending on whether X is negative, zero, or positive.
SIN(X) 
    Returns the sine of X, where X is given in radians.
SQRT(X) 
    Returns the non-negative square root of X.
TAN(X) 
    Returns the tangent of X, where X is given in radians.
TRUNCATE(X,D) 
    Returns the number X, truncated to D decimals.

date and time functions :
ADDDATE(date,INTERVAL expr type) 
    See SUBDATE().
CURDATE() 
    Synonym for CURRENT_DATE.
CURRENT_DATE 
    Returns today's date as a value in 'YYYY-MM-DD' or YYYYMMDD format,
    depending on whether the function is used in a string or numeric context.
CURRENT_TIME 
    Returns the current time as a value in 'HH:MM:SS' or HHMMSS format,
    depending on whether the function is used in a string or numeric context.
CURRENT_TIMESTAMP 
    Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format,
    depending on whether the function is used in a string or numeric context.
CURTIME()
    Synonym for CURRENT_TIME.
DATE_ADD(date,INTERVAL expr type) 
    Synonym for ADDDATE().
DATE_FORMAT(date,format) 
    Formats the date value according to the format string.
        Specifier  Description
        %M  Month name (January..December)  
        %W  Weekday name (Sunday..Saturday)  
        %D  Day of the month with English suffix (1st, 2nd, 3rd, etc.)  
        %Y  Year, numeric, 4 digits  
        %y  Year, numeric, 2 digits  
        %X  Year for the week where Sunday is the first day of the week, numeric, 4 digits, used with '%V'
        %x  Year for the week, where Monday is the first day of the week, numeric, 4 digits, used with '%v'
        %a  Abbreviated weekday name (Sun..Sat)  
        %d  Day of the month, numeric (00..31)  
        %e  Day of the month, numeric (0..31)  
        %m  Month, numeric (01..12)  
        %c  Month, numeric (1..12)  
        %b  Abbreviated month name (Jan..Dec)  
        %j  Day of year (001..366)  
        %H  Hour (00..23)  
        %k  Hour (0..23)  
        %h  Hour (01..12)  
        %I  Hour (01..12)  
        %l  Hour (1..12)  
        %i  Minutes, numeric (00..59)  
        %r  Time, 12-hour (hh:mm:ss [AP]M)  
        %T  Time, 24-hour (hh:mm:ss)  
        %S  Seconds (00..59)  
        %s  Seconds (00..59)  
        %p  AM or PM  
        %w  Day of the week (0=Sunday..6=Saturday)  
        %U  Week (00..53), where Sunday is the first day of the week  
        %u  Week (00..53), where Monday is the first day of the week  
        %V  Week (01..53), where Sunday is the first day of the week. Used with '%X'  
        %v  Week (01..53), where Monday is the first day of the week. Used with '%x'  
        %%  A literal '%'.  
DATE_SUB(date,INTERVAL expr type) 
    Synonym for SUBDATE().
DAYNAME(date) 
    Returns the name of the weekday for date.
DAYOFMONTH(date) 
    Returns the day of the month for date, in the range 1 to 31.
DAYOFWEEK(date) 
    Returns the weekday index for date (1 = Sunday, 2 = Monday, ... 7 = Saturday).
DAYOFYEAR(date) 
    Returns the day of the year for date, in the range 1 to 366.
EXTRACT(type FROM date) 
    Uses the same kinds of interval type specifiers as SUBDATE(),
    but extracts parts from the date rather than performing date arithmetic. 
FROM_DAYS(N) 
    Given a daynumber N, returns a DATE value.
FROM_UNIXTIME(unix_timestamp[,format]) 
    If used without an argument, returns a representation of the unix_timestamp argument
    as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format,
    depending on whether the function is used in a string or numeric context.
    If used with a second argument, returns a string representation of the Unix timestamp,
    formatted according to the format string.
    format may contain the same specifiers as those listed in the entry for the DATE_FORMAT() function.
HOUR(time) 
    Returns the hour for time, in the range 0 to 23.
MINUTE(time) 
    Returns the minute for time, in the range 0 to 59.
MONTH(date) 
    Returns the month for date, in the range 1 to 12.
MONTHNAME(date) 
    Returns the name of the month for date.
NOW() 
    Synonym for CURRENT_TIMESTAMP.
    Multiple references to NOW() within a single query will always give the same time.
PERIOD_ADD(P,N) 
    Adds N months to period P (in the format YYMM or YYYYMM). Returns a value in the format YYYYMM.
PERIOD_DIFF(P1,P2) 
    Returns the number of months between periods P1 and P2.
    P1 and P2 should be in the format YYMM or YYYYMM.
QUARTER(date) 
    Returns the quarter of the year for date, in the range 1 to 4.
SECOND(time) 
    Returns the second for time, in the range 0 to 59.
SEC_TO_TIME(seconds) 
    Returns the seconds argument, converted to hours, minutes, and seconds,
    as a value in 'HH:MM:SS' or HHMMSS format,
    depending on whether the function is used in a string or numeric context.
SUBDATE(date,INTERVAL expr type) 
    date is a DATETIME or DATE value specifying the starting date.
    expr is an expression specifying the interval value to be added or subtracted from the starting date.
    expr is a string; it may start with a '-' for negative intervals.
    type is a keyword indicating how the expression should be interpreted.
    The related function EXTRACT(type FROM date) returns the 'type' interval from the date.
        type value     Expected expr format  
        SECOND         SECONDS  
        MINUTE         MINUTES  
        HOUR           HOURS  
        DAY            DAYS  
        MONTH          MONTHS  
        YEAR           YEARS  
        MINUTE_SECOND  "MINUTES:SECONDS"  
        HOUR_MINUTE    "HOURS:MINUTES"  
        DAY_HOUR       "DAYS HOURS"  
        YEAR_MONTH     "YEARS-MONTHS"  
        HOUR_SECOND    "HOURS:MINUTES:SECONDS"  
        DAY_MINUTE     "DAYS HOURS:MINUTES"  
        DAY_SECOND     "DAYS HOURS:MINUTES:SECONDS"  
SYSDATE() 
    Synonym for CURRENT_TIMESTAMP.
TIME_FORMAT(time,format) 
    This is used like the DATE_FORMAT() function,
    but the format string may contain only those format specifiers
    that handle hours, minutes, and seconds. Other specifiers produce a NULL value or 0. 
TIME_TO_SEC(time) 
    Returns the time argument, converted to seconds.
TO_DAYS(date) 
    Given a date date, returns a daynumber (the number of days since year 0).
UNIX_TIMESTAMP([date]) 
    If called with no argument,
    returns a Unix timestamp (seconds since '1970-01-01 00:00:00' GMT) as an unsigned integer.
    If UNIX_TIMESTAMP() is called with a date argument,
    it returns the value of the argument as seconds since '1970-01-01 00:00:00' GMT.
    date may be a DATE string, a DATETIME string, a TIMESTAMP,
    or a number in the format YYMMDD or YYYYMMDD in local time.
WEEK(date[,first]) 
    With a single argument, returns the week for date, in the range 0 to 53,
    for locations where Sunday is the first day of the week.
    The week starts on Sunday if the second argument is 0, on Monday if the second argument is 1.
WEEKDAY(date) 
    Returns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 = Sunday).
YEAR(date) 
    Returns the year for date, in the range 1000 to 9999.
YEARWEEK(date[,first]) 
    Returns year and week for a date. The second arguments works exactly like the second argument to WEEK().


privilege types
ALL [PRIVILEGES]         Sets all simple privileges except WITH GRANT OPTION
ALTER                    Allows usage of ALTER TABLE
CREATE                   Allows usage of CREATE TABLE
CREATE TEMPORARY TABLES  Allows usage of CREATE TEMPORARY TABLE
DELETE                   Allows usage of DELETE
DROP                     Allows usage of DROP TABLE.
EXECUTE                  Allows the user to run stored procedures (for MySQL 5.0)
FILE                     Allows usage of SELECT ... INTO OUTFILE and LOAD DATA INFILE.
INDEX                    Allows usage of CREATE INDEX and DROP INDEX
INSERT                   Allows usage of INSERT
LOCK TABLES              Allows usage of LOCK TABLES on tables for which on has the SELECT privilege.
PROCESS                  Allows usage of SHOW FULL PROCESSLIST
REFERENCES               For the future
RELOAD                   Allows usage of FLUSH
REPLICATION CLIENT       Gives the right to the user to ask where the slaves/masters are.
REPLICATION SLAVE        Needed for the replication slaves (to read binlogs from master).
SELECT                   Allows usage of SELECT
SHOW DATABASES           SHOW DATABASES shows all databases.
SHUTDOWN                 Allows usage of mysqladmin shutdown
SUPER                    Allows one connect (once) even if max_connections is reached and execute commands
                         CHANGE MASTER, KILL thread, mysqladmin debug, PURGE MASTER LOGS and SET GLOBAL
UPDATE                   Allows usage of UPDATE
USAGE                    Synonym for ``no privileges.''


query statements
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]

alter_specification:
        ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
  or    ADD [COLUMN] (create_definition, create_definition,...)
  or    ADD INDEX [index_name] (index_col_name,...)
  or    ADD PRIMARY KEY (index_col_name,...)
  or    ADD UNIQUE [index_name] (index_col_name,...)
  or    ADD FULLTEXT [index_name] (index_col_name,...)
  or	ADD [CONSTRAINT symbol] FOREIGN KEY index_name (index_col_name,...)
            [reference_definition]
  or    ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
  or    CHANGE [COLUMN] old_col_name create_definition
               [FIRST | AFTER column_name]
  or    MODIFY [COLUMN] create_definition [FIRST | AFTER column_name]
  or    DROP [COLUMN] col_name
  or    DROP PRIMARY KEY
  or    DROP INDEX index_name
  or    DISABLE KEYS
  or    ENABLE KEYS
  or    RENAME [TO] new_tbl_name
  or    ORDER BY col
  or    table_options


CREATE DATABASE [IF NOT EXISTS] db_name;


CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
[table_options] [select_statement]

create_definition:
  col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
            [PRIMARY KEY] [reference_definition]
  or    PRIMARY KEY (index_col_name,...)
  or    KEY [index_name] (index_col_name,...)
  or    INDEX [index_name] (index_col_name,...)
  or    UNIQUE [INDEX] [index_name] (index_col_name,...)
  or    FULLTEXT [INDEX] [index_name] (index_col_name,...)
  or    [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
            [reference_definition]
  or    CHECK (expr)

type:
        TINYINT[(length)] [UNSIGNED] [ZEROFILL]
  or    SMALLINT[(length)] [UNSIGNED] [ZEROFILL]
  or    MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]
  or    INT[(length)] [UNSIGNED] [ZEROFILL]
  or    INTEGER[(length)] [UNSIGNED] [ZEROFILL]
  or    BIGINT[(length)] [UNSIGNED] [ZEROFILL]
  or    REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]
  or    DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]
  or    FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]
  or    DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL]
  or    NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL]
  or    CHAR(length) [BINARY]
  or    VARCHAR(length) [BINARY]
  or    DATE
  or    TIME
  or    TIMESTAMP
  or    DATETIME
  or    TINYBLOB
  or    BLOB
  or    MEDIUMBLOB
  or    LONGBLOB
  or    TINYTEXT
  or    TEXT
  or    MEDIUMTEXT
  or    LONGTEXT
  or    ENUM(value1,value2,value3,...)
  or    SET(value1,value2,value3,...)

index_col_name:
        col_name [(length)]

reference_definition:
        REFERENCES tbl_name [(index_col_name,...)]
                   [MATCH FULL | MATCH PARTIAL]
                   [ON DELETE reference_option]
                   [ON UPDATE reference_option]

reference_option:
        RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT

table_options:
	TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM }
or	AUTO_INCREMENT = #
or	AVG_ROW_LENGTH = #
or	CHECKSUM = {0 | 1}
or	COMMENT = "string"
or	MAX_ROWS = #
or	MIN_ROWS = #
or	PACK_KEYS = {0 | 1 | DEFAULT}
or	PASSWORD = "string"
or	DELAY_KEY_WRITE = {0 | 1}
or      ROW_FORMAT= { default | dynamic | fixed | compressed }
or	RAID_TYPE= {1 | STRIPED | RAID0 } RAID_CHUNKS=#  RAID_CHUNKSIZE=#
or	UNION = (table_name,[table_name...])
or	INSERT_METHOD= {NO | FIRST | LAST }
or      DATA DIRECTORY="absolute path to directory"
or      INDEX DIRECTORY="absolute path to directory"

select_statement:
	[IGNORE | REPLACE] SELECT ...  (Some legal select statement)


DELETE [LOW_PRIORITY | QUICK] FROM table_name
       [WHERE where_definition]
       [ORDER BY ...]
       [LIMIT rows]
or
DELETE [LOW_PRIORITY | QUICK] table_name[.*] [,table_name[.*] ...]
       FROM table-references
       [WHERE where_definition]
or
DELETE [LOW_PRIORITY | QUICK]
       FROM table_name[.*], [table_name[.*] ...]
       USING table-references
       [WHERE where_definition]


{DESCRIBE | DESC} tbl_name {col_name | wild}


DROP DATABASE [IF EXISTS] db_name;


DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT | CASCADE]


INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
        [INTO] tbl_name [(col_name,...)]
        VALUES (expression,...),(...),...
or
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
        [INTO] tbl_name [(col_name,...)]
        SELECT ...
or
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
        [INTO] tbl_name
        SET col_name=expression, col_name=expression, ...


GRANT priv_type [(column_list)] [, priv_type [(column_list)] ...]
    ON {tbl_name | * | *.* | db_name.*}
    TO user_name [IDENTIFIED BY [PASSWORD] 'password']
        [, user_name [IDENTIFIED BY 'password'] ...]
    [REQUIRE
    	[{SSL| X509}]
	[CIPHER cipher [AND]]
	[ISSUER issuer [AND]]
	[SUBJECT subject]]
    [WITH [GRANT OPTION | MAX_QUERIES_PER_HOUR # |
                          MAX_UPDATES_PER_HOUR # |
                          MAX_CONNECTIONS_PER_HOUR #]]


LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
    [REPLACE | IGNORE]
    INTO TABLE tbl_name
    [FIELDS
        [TERMINATED BY '\t']
        [[OPTIONALLY] ENCLOSED BY '']
        [ESCAPED BY '\\' ]
    ]
    [LINES TERMINATED BY '\n']
    [IGNORE number LINES]
    [(col_name,...)]


RENAME TABLE tbl_name TO new_tbl_name[, tbl_name2 TO new_tbl_name2,...]


REVOKE priv_type [(column_list)] [, priv_type [(column_list)] ...]
    ON {tbl_name | * | *.* | db_name.*}
    FROM user_name [, user_name ...]


SELECT [STRAIGHT_JOIN]
       [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
       [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] [HIGH_PRIORITY]
       [DISTINCT | DISTINCTROW | ALL]
    select_expression,...
    [INTO {OUTFILE | DUMPFILE} 'file_name' export_options]
    [FROM table_references
      [WHERE where_definition]
      [GROUP BY {unsigned_integer | col_name | formula} [ASC | DESC], ...]
      [HAVING where_definition]
      [ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] ,...]
      [LIMIT [offset,] rows]
      [PROCEDURE procedure_name]
      [FOR UPDATE | LOCK IN SHARE MODE]]


SHOW DATABASES [LIKE wild]
or SHOW [OPEN] TABLES [FROM db_name] [LIKE wild]
or SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE wild]
or SHOW INDEX FROM tbl_name [FROM db_name]
or SHOW TABLE STATUS [FROM db_name] [LIKE wild]
or SHOW STATUS [LIKE wild]
or SHOW VARIABLES [LIKE wild]
or SHOW LOGS
or SHOW [FULL] PROCESSLIST
or SHOW GRANTS FOR user
or SHOW CREATE TABLE table_name
or SHOW MASTER STATUS
or SHOW MASTER LOGS
or SHOW SLAVE STATUS


UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
    SET col_name1=expr1 [, col_name2=expr2, ...]
    [WHERE where_definition]
    [LIMIT #]


USE db_name


For more, visit SQL command, type and function index.
Last updated on . - Qindex.info -