Numeric data types in MySQL

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

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
Primary Key constraint Create Table DataType date List tables and Database
Copy Table & SHOW CREATE Table
SQL References Data Types
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










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