1. Value Type
2, string type 3, date and time 4, Enum and set5, ry data type option unsigned no negative zerofill value display has an effect, auto_increment serial default value = declare auto_increment not null tinyint-128 ---- 127 smallint-32768 ---- 32767 mediumint-8388608 ----- 8388607int (integer) -2147483648 ---- 2147483647 bigint-numeric floating point float 4 bytes plus and minus 1.175494351e-38 ----- plus and minus 3.402823466e + 38 double 8 bytes plus and minus 2.225074255072014e-308 --- plus and minus + 308 Fixed Points decdecdecimalbit
Char 0-255varchar 0-65535 tinyblob 0-255blob 0-65535mediumblob between 0-4294967295 tinytext 0-255text 0-65535mediumtext between 0-4294967295 binary characters, only binary characters varbinary 0-mbinary 0-m Date 1000-01-01----9999-12-31 datetime 1000-01-01-00:00:00 ---- 9999-12-31 23: 59: 59 time-838: 59: 59 ---- 838: 59: 59 year 1901 ---- 2155 timestamp 1970 10 10 80001----2038 time-related functions Now current_timestamp sysdate 1. Now and current_timestamp are the same 2. The sysdate function returns the time when the current function is executed, and the time when the now function returns the SQL statement. Time addition and subtraction If the target year is a leap month, the system automatically adds or subtracted one day. Date_add (date, interval expr unit) date_sub (date, interval expr unit) date_add (now (), interval 1 day) unit can be the following data: yearmonthdayweekhourminutesecondmicrosecond select Date_format (now (), '% Y % m % D ') As datetime;