Basic Data type of MYSQL

Data types comes in several forma and sizes, allowing the programmer to create tables suited to the scope of the project.
[table caption=”” width=”650″ colwidth=”150|500″ colalign=”left|left] Data Type, Description
CHAR(size), This type is used to store character strings values of fixed length. The size in brackets determines  the number of characters the cell can hold. The maximum number of character(i.e the size) this data type can hold is 255 characters. Ex- EmployeName CHAR(100)
VARHAR(size), This data type is used to store variable length alphanumeric data. It is more flexible from of the CHAR data. VARCHAR can hold 1 to 255 characters. CHAR is much faster than VARCHAR sometimes up to 50%.
INT,The INT data type used to store number. An Integer – 2147483648 to 2147483647.
DECIMAL, A floating  point number that can specify the number of permissible digits. For example
DOUBLE, A long double-precision floating point number.
DATE, A Date in YYYY-MM-DD format.
TIME, A time in the HH:MM:SS format.
DATETIME, A Combined date and time in the format YYYY-MM-DD HH:MM:SS
TIMESTAMP, Automatic date and time of last record entry
TEXT, A String upto 65535 characters long.
BLOB, A binary type for variable data.

The DECIMAL data type  parameter specify the total number of permissible digits and the number of digits that may follow the decimal point  not the number of permissible digits for the decimal point’s left side and right side.
e.g : DECIMAL(5,2) permits -999.99 to 999.99


Anuj Kumar

I'm Anuj kumar a web developer with 4+ year experience .I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to is provide php , jquery , mysql , phpoops and other web development tutorials. I am trying best effort to make PHPGurukul useful for every single moment spend on this website. If you think this website is useful to visit please share with your friend and buddies.

Recommended Tutorials for you

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *