Home Mysql Mysql5 MySQL Column Type Database

Related Tutorials


 
 

Share on Google+Share on Google+

MySQL Column Type Database

Advertisement
In this session you will learn how to support number of column in MySQL . MySQL supports the numeric type , Date and time type, and String type (char) database.

MySQL Column Type Database

     

In this session you will learn how to support number of column in MySQL . MySQL supports the numeric type , Date and time type, and String type (char) database.

MySQL Numeric type and String type Database :

  TYPE BYTE  MINIMUM VALUE MAXIMUM VALUE
TINYINT  1 Byte -128 127
BIT (M+7)/8 Byte   - -
SMALLINT 2 Byte -32768 32767
MEDIUMINT 3 Byte -8388608 8388607
INT(M) (UNSIGNED) (ZEROFILL) 4 Byte -2147483648 2147483647
INTERGER [M] 4 Byte  - -
BIGINT [M] 8 Byte -9223372036854775808 9223372036854775807
FLOAT [precision] 4 Byte
FLOAT [(M, D)] 8 Byte
DOUBLE [(M,D)] 8 Byte
DOUBLE precision [(M, D)] 8 Byte  -1.7976931348623157E+308 to-2.2250738585072014E-308, 0, 2.2250738585072014E-308 to 1.7976931348623157E+308
REAL [(M, D)] 8 Byte 
DECIMAL [(M ,D)] M+2 Byte  -999.99 999.99
NUMERIC[(M,D)] M+2 Byte 
VARCHAR  L+1 Byte  0 255
CHAR M Byte  0 255
TINYBLOB L+1 Byte  0 256
TINYTEXT L+1 Byte  0 255  (2^8-1) Char 
BLOB OR TEXT L+2 Byte   0  65,535 (2^16-1)char 
MEDIUMBLOB  L+3 Byte  - 16,777,215(2^24-1)char
MEDIUMTEXT L+3 Byte  - 16,777,215(2^24-1)char
LONGBLOB L+4 Byte   - 4,294,967,295(2^32-1)char
LONGTEXT L+4 Byte   - 4,294,967,295 or 4GB
ENUM ('value1, value2',..) 1 or  2 Byte  65,535
SET ('value1,' value 2,' .....) 1 to 8 Byte 0 64

MySQL Store the Date and Time Type

  Column Type     Store Data
DATE 3 Byte
DATETIME 8 Byte
TIMESTAMP 4 Byte
TIME 3 Byte
YEAR 1 Byte
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 9, 2006

Related Tutorials

Discuss: MySQL Column Type Database  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
dkn
June 19, 2012
error in executing query

I am getting error while executing query in mysql.pls suggest CREATE TABLE EMPLOYEE ( RealID int NOT NULL IDENTITY (1, 1), EMP_NAME VARCHAR(30), EMP_ID AS 'EMP' + RIGHT('000000000' + CAST(RealID as varchar(10)), 3) CONSTRAINT PK_EMPLOYEE PRIMARY KEY CLUSTERED (EMP_ID) )
DMCA.com