Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,851 questions

51,772 answers

573 users

What are the MySQL Data Types?

1 Answer

0 votes
Text types:
-----------

CHAR(size) - Store up to 255 characters (letters, numbers, and special characters).
VARCHAR(size) - Store up to 255 characters (letters, numbers, and special characters).
TINYTEXT - Store up to 255 characters.
TEXT - Store up to 65,535 characters.
BLOB - Store up to 65,535 bytes (Binary OBjects). 
MEDIUMTEXT - Store up to 16,777,215 characters.
MEDIUMBLOB - Store up to 16,777,215 bytes (Binary OBjects). 
LONGTEXT - Store up to 4,294,967,295 characters.
LONGBLOB - Store up to 4,294,967,295 bytes (Binary OBjects). 


Number types:
-------------

TINYINT	: 1 Bytes : -128 .. +127 : 0 .. 255
SMALLINT : 2 Bytes : -32768 .. +32767 : 0 .. 65535
MEDIUMINT : 3 Bytes : -8388608 .. +8388607 : 0 .. 16777215
INT : 4 Bytes : -2147483648 .. +2147483647 : 0 .. 4294967295
BIGINT : 8 Bytes : -9223372036854775808 .. 9223372036854775807 : 0 .. 18446744073709551615
FLOAT(size,d) : Small number with a floating decimal point. 
DOUBLE(size,d) : Large number with a floating decimal point. 


Date types:
-----------

DATE() :  YYYY-MM-DD (from '1000-01-01' to '9999-12-31').
DATETIME() : YYYY-MM-DD HH:MI:SS (from '1000-01-01 00:00:00' to '9999-12-31 23:59:59').
TIMESTAMP() : YYYY-MM-DD HH:MI:SS (from '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC). 
TIME() : HH:MI:SS (from '-838:59:59' to '838:59:59').
YEAR() : 1901 to 2155




 



answered Sep 27, 2015 by avibootz
edited Sep 27, 2015 by avibootz
...