MySQL Learning notes-data types

Source: Internet
Author: User

Integer type:

Type Number of bytes Default display width
TINYINT 1 4
SMALLINT 2 6
Mediumint 3 9
Int 4 11
INTEGER 4 11
BIGINT 8 20

Zerofill parameter: The digital display space is filled by the decimal, can only represent the unsigned number

The setting display width is invalid when the actual width of the data is greater than the setting display width, but the actual width of the data cannot be greater than the default display width

Integer types can be self-increasing.

Floating-point type and fixed-point number type:

are used to denote decimals

Type Number of bytes
FLOAT 4
DOUBLE 8
DECIMAL (M,D) M+2

Data type (M,D): Total length of M data D length after decimal point

When rounding, FLOAT and double do not error, decimal will have warning

Fixed-point numbers are stored as strings

Date and Time type

MySQL Learning notes-data types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.