MySQL data type (02)

Source: Internet
Author: User

MySQL database names are case-sensitive, depending on the file system, Windows does not differentiate, Linux differentiates.

MySQL Database type

integer type: TINYINT SMALLINT mediumint INT BIGINT

Number of bytes: 1 2 3 4 8

modifier unsigned (unsigned) not null (non-empty)


Floating-point type: single-precision (float) double-precision (double)

Number of bytes: 4 8

fixed-point number type: DECIMAL (M,D)

Number of bytes: m+2

Date and time format:

Data type Number of bytes Range of values Date format 0 value
Year 1 1901-2155 YYYY 0000
DATE 4 1000-01-01~9999-12-3 Yyyy-mm-dd 0000-00-00
Time 3 -838:59:59~838:59:59 HH:MM:SS 00:00:00
Datetime 8 1000-01-01 00:00:00~9999-12-31 23:59:59

Yyyy-mm-dd

HH:MM:DD

0000-00-00

00:00:00

TIMESTAMP 4 1970-01-01 00:00:01~2038-01-19 03:14:07

Yyyy-mm-dd

HH:MM:DD

0000-00-00

00:00:00

string and binary types

Data type Type description
CHAR Fixed-length strings
VARCHAR Variable-length strings
BINARY Fixed-length binary
Varbiary Variable-length binary
Blob Binary Big Data Tablets, PDF documents
TEXT Large text data Article
Enum Enum type
SET String Object
BIT Bit field type



This article is from "Up for the future ..." Blog, be sure to keep this source http://goodang.blog.51cto.com/10277564/1762770

MySQL data type (02)

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.