MySQL: Data Types List

Profile picture for user arilio666

MySQL data types define what value and the kind of value a table has in store. Like any other datatype, MySQL also has a string, integer, etc.

An SQL developer must decide which datatype to be used for a particular value in the table row to be stored, let it be number or name it should be defined by data type.

MySQL has a list of datatypes available they are as follows:

1. String Data Types

  • CHAR(size)    
  • VARCHAR(size)    
  • BINARY(size)    
  • VARBINARY(size)    
  • TINYBLOB    
  • TINYTEXT    
  • TEXT(size)    
  • BLOB(size)    
  • MEDIUMTEXT    
  • MEDIUMBLOB    
  • LONGTEXT    
  • LONGBLOB    
  • ENUM(val1, val2, val3, ...)    
  • SET(val1, val2, val3, ...)

2. Numeric Data Types

  • BIT(size)    
  • TINYINT(size)    
  • BOOL    
  • BOOLEAN    
  • SMALLINT(size)    
  • MEDIUMINT(size)    
  • INT(size)    
  • INTEGER(size)    
  • BIGINT(size)    
  • FLOAT(size, d)    
  • FLOAT(p)    
  • DOUBLE(size, d)    
  • DOUBLE PRECISION(size, d)     
  • DECIMAL(size, d)    
  • DEC(size, d)

3. Date And Time Data Types

  1. DATE    
  2. DATETIME(fsp)    
  3. TIMESTAMP(fsp)    
  4. TIME(fsp)    
  5. YEAR
Tags