Numeric data types in MySQL

Numeric Type
FieldStorage
Bytes
Min
Signed
Min
UnSigned
Max
Signed
Max
UnSigned
Tnyint1-1280127255
Smallint2-3276803276765535
Mediumint3-83886080838860716777215
Int4-2147483648021474836474294967295
Bigint8-2630263264

Decimal( Precission, Scale )

Precission : 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


plus2net.com



Post your comments , suggestion , error , requirements etc here .
















We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer