TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL Numeric Data types

Overview

In this tutorial, we will learn MySQL Numeric Data types. MySQL supports many data types to store numeric data like
integer data types, floating-point types, fixed-point types, etc.

Integer Data Types

The integer data type is used for storing whole numbers.
Whole numbers do not have decimal digits. For example, 25 is a whole number and 32.7 is not a whole number.

The following is the list of numeric data types:

 

Integer Data typeDescription
TINYINTUsed for very small integer
SMALLINTUsed for small integer
MEDIUMINTUsed for medium-sized integer
INTEGERUsed for normal integer
BIGINTUsed for large integer

Floating-Point Data Types

The floating-point data types are used to represent approximate-value numbers that have an integer part, a fractional part, or both. The floating-point data types are:

FLOAT – Single-precision floating-point number
DOUBLE – Double-precision) floating-point number

These types represent values in the native binary floating-point format (IEEE 754).

Syntax

The FLOAT data type is assigned using the syntax:

FLOAT (N, D)

N is the maximum number of decimal digits and D is the number of digits following the decimal point. A single-precision floating-point integer is accurate to approximately 7 decimal places.

The DOUBLE data type is assigned using the syntax:

DOUBLE (N, D)

N is the maximum number of decimal digits and D is the number of digits following the decimal point. A double-precision floating-point integer is accurate to approximately 15 decimal places.

Fixed-Point Data Types

The fixed-point data type in MySQL is DECIMAL. DECIMAL data type is used to represent exact-value numbers that have an integer part, a fractional part, or both.

All values of the DECIMAL column have the same number of decimal places and are stored exactly as specified.

The DECIMAL data type is assigned using the syntax:

DECIMAL (N, D)

N is the maximum number of significant digits that can be stored and D is the number of digits following the decimal point (from 1 to 255).

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

Windows 11 Services Run Prompt

MySQL /

Start MySQL Server on Windows 11

MySQL Download Windows 11

MySQL /

Download & Install MySQL on Windows 11

‹ MySQL String Data Types› MySQL Temporal Data Types

Recent Posts

  • Flowchart Control structures
  • Draw a Square using Turtle Graphics
  • Flowgorithm File Errors
  • Write to Text File using Flowgorithm
  • Read Text File using Flowgorithm
  • Flowgorithm Turtle Graphics Flowchart
  • Update Flowgorithm to Latest Version
  • Flowgorithm File Symbols
  • Flowgorithm Turtle Graphics
  • Flowgorithm 3 New Features

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version