Data type in MySQL Part - 3



Hello and welcome everyone. In the previous article, we have learned about Data type and Date and Time data type. Now in this article, we will learn Numeric Data type. Let’s go.
MongoDB with .Net Core course link => https://www.udemy.com/mongodb-with-net-core-sagar-jaybhay/

Web API 2- .Net Core In depth In 5 Hours click on: https://www.udemy.com/web-api-2-net-core-in-depth-in-5-hrs-with-sagar-jaybhay/

Numeric Data type
INT ()
BIT ()
BOOL ()
BOOLEAN ()
TINYINT ()
SMALLINT ()
MEDIUMINT ()
BIGINT ()
FLOAT ()
DOUBLE ()
DECIMAL ()
Now let see in details one by one:
INT ()

INT data types that can be signed range allow is from -2147483648 to 2147483647 and it can be unsigned range allow is from 0 to 4294967925. INT data type storage size is 4 bytes and you can specify the width of up to 11 digits.

BIT ()

The BIT data type is a value type and it’s specified in size per value. The BIT default value for size is 1 and bit is a field.

BOOL ()

BOOL data type considered zero value as false and non-zero values are true.


BOOLEAN ()

The BOOLEAN data type is the same as to BOOL data type.

TINYINT ()

TINYINT data type is a very small integer. That can be signed range allow is from -128 to 127 and it can be unsigned range allow is from 0 to 255. TINYINT data storage size is 1 byte and you can specify a width of up to 4 digits.

SMALLINT ()

SMALLINT data types that can be signed range allow is from -32768 to 32767 and it can be unsigned range allow is from 0 to 65535. SMALLINT data type storage size is 2 bytes and you can specify the width of up to 5 digits.

MEDIUMINT ()

MEDIUMINT data types that can be signed range allow is from -8388608 to 8388607 and it can be unsigned range allow is from 0 to 16777215. MEDIUMINT data type storage size is 3 bytes and you can specify the width of up to 9 digits.

BIGINT ()

BIGINT data types that can be signed range allow is from -9223372036854775808 to 9223372036854775807 and it can be unsigned range allow is from 0 to 18446744073709551615. MEDIUMINT data type storage size is 8 bytes and you can specify the width of up to 20 digits.

FLOAT ()

The FLOAT data type is a small number with a floating decimal point. In this data type, the total number of digits are specified in size. Float data type you can define the display length (M) and the number of decimals (D). In this data type size, the parameter is used to specify the maximum number of digits, and the D parameter is used to specify the maximum number of digits to the right of the decimal, like will default to 10, 2 where 2 is the number of decimals and 10 is the total number of digits. FLOAT data type storage size is 4 bytes.

DOUBLE ()

DOUBLE data type a large number with a floating point number that cannot be unsigned. In this data type size, the parameter is used to specify the maximum number of digits, and the D parameter is used to specify the maximum number of digits to the right of the decimal, like will default to 16, 4 where 4 is the number of decimals. DOUBLE decimal precision can go to 53 places. DOUBLE data type storage size is 8 bytes.

DECIMAL ()

DECIMAL data type is an exact fixed point number. In this data type, the total number of digits are specified in size. In this data type size, the parameter is used to specify the maximum number of digits, and the D parameter is used to specify the maximum number of digits to the right of the decimal. DECIMAL data type storage size is length + 1 bytes or length + 2 bytes. For decimal substitute is a Numeric.

In this article, we are learned about Numeric Data type. In the next article, we will learn about String Data type.
MongoDB with .Net Core course link => https://www.udemy.com/mongodb-with-net-core-sagar-jaybhay/

Web API 2- .Net Core In depth In 5 Hours click on: https://www.udemy.com/web-api-2-net-core-in-depth-in-5-hrs-with-sagar-jaybhay/


Comments

Popular posts from this blog

ALTER statement in MySQL

MySQL Constraint – PRIMARY KEY

Order By Clause in MySQL