MySQL Data Types

Great day everyone, this tutorial is all about MySQL Data Types.

Today, I will teach you everything you need to know about MySQL Data Types.

As a programmer, you need to know every kind of data type, so let’s get started:

MySQL supports several SQL data types in various categories: numeric types, date and time types, string (character and byte) types, and spatial types.

This tutorial provides an overview of these data types, a detailed description of the properties of the types in each category, and a summary of the data type storage requirements.

Data types come in various forms and sizes, allowing programmers to create tables suited to the scope of their projects.

Data TypeDescription
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%.
INTThe INT data type used to store number. An Integer – 2147483648 to 2147483647.
DECIMALA long double-precision floating point number.
DOUBLEA long double-precision floating point number
DATEA Date in YYYY-MM-DD format.
TIMEA time in the HH:MM:SS format.
DATETIMEA Combined date and time in the format YYYY-MM-DD HH:MM:SS
TIMESTAMPAutomatic date and time of last record entry
TEXTA String upto 65535 characters long.
BLOBA binary type for variable data.

 

That’s it! I hope you learn something today about MySQL Data Types

If you have any comments or suggestions about MySQL Data Types Please message us Directly:

Other Articles you might read also:

 

Leave a Comment