Data types in MySQL
Numeric Type
Field | Storage Bytes | Min Signed | Min UnSigned | Max Signed | Max UnSigned |
Tnyint | 1 | -128 | 0 | 127 | 255 |
Smallint | 2 | -32768 | 0 | 32767 | 65535 |
Mediumint | 3 | -8388608 | 0 | 8388607 | 16777215 |
Int | 4 | -2147483648 | 0 | 2147483647 | 4294967295 |
Bigint | 8 | -263 | 0 | 263 | 264 |
Decimal( Precision, Scale )
Precision : Number of Significant digits
Scale : Number digits after decimal point.
Example : Price DECIMAL(5,3)
Here Maximum Price ( value ) we can store is -99.999 to 99.999
Decimal is used where exact and accurate value is to be stored like monetary values.
FLOAT ( M,D)
M : Digits in total
D : Digits after decimal
Example : average_value FLOAT(4,2)
Here we can insert data in range of -99.99 to 99.99
Float is 32 bit single precision.
DOUBLE (M, D)
M : Digits in total
D : Digits after decimal
Example : value FLOAT(5,2)
Here we can insert data in range of -999.99 to 999.99
Double is 64 bit double precision.
REAL (M, D)
M : Digits in total
D : Digits after decimal
Example : value REAL(5,2)
Here we can insert data in range of -999.99 to 999.99
Numeric Datatypes → Date Datatypes →
Boolean →
Blob →
Create table → Copy table → List Tables and Databases →
←What is SQL
Installation of Database →
Managing MySQL →
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com