What are the data types available in MySQL?
By Siddu S Hosageri
Different data types available in MySQL?
Teacher SiliconIndia replied to Siddu S Hosageri Tuesday, October 27, 2009
Hi siddu,
Below ones are the data types avialable in mysql.
varchar => A variable section from 0 to 255 characters long.
tinyint => A string with a maximum length of 255 characters.
text => A string with a maximum length of 65535 characters.
date => YYYY-MM-DD.
smallint mediumint int => -2147483648 to 2147483647 normal 0 to 4294967295 UNSIGNED.
bigint => -9223372036854775808 to 9223372036854775807 normal 0 to 18446744073709551615 UNSIGNED.
float => A small number with a floating decimal point.
double => A large number with a floating decimal point.
decimal => A DOUBLE stored as a string , allowing for a fixed decimal point.
datetime => YYYY-MM-DD HH:MM:SS. timestamp => YYYYMMDDHHMMSS.
time => HH:MM:SS. year
char => CHAR( ) A fixed section from 0 to 255 characters long.
blob => A string with a maximum length of 65535 characters.BLOB stands for Binary Large OBject.
mediumblob => A string with a maximum length of 16777215 characters.
longblob => A string with a maximum length of 4294967295 characters.
longtext enum => Short for ENUMERATION which means that each column may have one of a specified possible values.
set => Similar to ENUM except each column may have more than one of the specified possible values.