MySQL Reference Sheet

Date/Time | Numeric | Strings

MySQL Date/Time

DATE_FORMAT(date,'format')

MySQLPHPDescription
Day  
%dd Day of the month, numeric (00..31)
%aDA textual representation of a day, three letters (Mon - Sun)
%ejDay of the month without leading zeros (0..31)
%DjSDay of the month with English suffix (0th, 1st, 2nd, 3rd, …)
%WlA full textual representation of the day of the week (Sunday - Saturday)
%wwDay of the week (0=Sunday..6=Saturday)
Month  
%MFMonth name (January..December)
%bMAbbreviated month name (Jan..Dec)
%cnMonth, numeric (0..12)
%mmMonth, numeric (00..12)
Year  
%YYYear, numeric, four digits
%yyYear, numeric (two digits)
Time  
%HHHour (00..23)
%hhHour (01..12)
%kGHour (0..23)
%lgHour (1..12)
%iiMinutes, numeric (00..59)
%ssSeconds (00..59)
%fuMicroseconds (000000..999999)
%pAAM or PM
%rg:i:s ATime, 12-hour (hh:mm:ss followed by AM or PM)
%TH:i:sTime, 24-hour (hh:mm:ss)
Misc  
%M %e, %YF j, YMonth Day, Year
%%%A literal % character

MySQL Numeric Types

Type Bytes Signed Unsigned
TINYINT 1 -128 to 127 0 to 255
SMALLINT 2 -32768 to 32767 0 to 65535
MEDIUMINT 3 -8388608 to 8388607 0 to 16777215
INT, INTEGER 4 -2147483648 to 2147483647 0 to 4294967295
BIGINT 8 -9223372036854775808 to 9223372036854775807 0 to 18446744073709551615
FLOAT 4
FLOAT(p) varies
DOUBLE [PRECISION], REAL 8
DECIMAL(M,D), NUMERIC(M,D) varies
BIT(M) ~ M+7

Best for Zip+4: INT UNSIGNED
Best for xxx-xxx-xxxx phone: BIGINT UNSIGNED

From MySQL 5.4 Reference Manual: Numeric Types

MySQL String Types

Type Bytes Notes
CHAR(M), BINARY(M) 0 - 255  
VARCHAR(M), VARBINARY(M) M + 1 <= 255; M + 2 > 255  
TINYBLOB, TINYTEXT 2 - 255  
BLOB, TEXT 3 - 65535  
MEDIUMBLOB, MEDIUMTEXT 4 - 16777215  
LONGBLOB, LONGTEXT 5 - 4294967295  
ENUM('value1','value2',...) 1 - 2 65,535 values maximum
SET('value1','value2',...) 1, 2, 4 or 8 64 values maximum

From MySQL 5.4 Reference Manual: Data Type Storage Requirements