mysql示例数据库_MySQL数据类型教程和示例

mysql示例数据库

mysql示例数据库

MySQL is a very advanced database server that is used by different types of companies. MySQL is used for different projects and cases in order to store different types of data in different formats. MySQL supports different types of data for storage, query, update, etc.

MySQL是一种非常先进的数据库服务器,供不同类型的公司使用。 MySQL用于不同的项目和案例,以便以不同的格式存储不同类型的数据。 MySQL支持不同类型的数据进行存储,查询,更新等。

MySQL常规数据类型 (MySQL General Data Types)

MySQL database server provides a lot of different types of data and these data types can be categorized like

MySQL数据库服务器提供了许多不同类型的数据,这些数据类型可以像

  • Numeric Data Types

    数值数据类型
  • Date and Time Data Types

    日期和时间数据类型
  • String Data Types

    字符串数据类型
  • Spatial Data Types

    空间数据类型

数值数据类型(Numeric Data Types)

Numeric data types are used to store numeric data like integer, floating-point which can be counted or used for calculations. MySQL provides a wide range of numeric data types to fit the user requirements while keeping the performance and space requirement less.

数值数据类型用于存储可以计算或用于计算的数值数据,例如整数,浮点数。 MySQL提供了各种各样的数字数据类型来满足用户需求,同时又降低了性能和空间需求。

Type Length
in Bytes
Minimum Value
(Signed)
Maximum Value
(Signed)
Minimum Value
(Unsigned)
Maximum Value
(Unsigned)
TINYINT 1 -128 127 0 255
SMALLINT 2 -32768 32767 65535
MEDIUMINT 3 -8388608 8388607 to 0 16777215
INT 4 -2147483648 2147483647 4294967295
BIGINT 8 -9223372036854775808 92233720368
54775807
184467440737
09551615
类型 长度
以字节为单位
最低值
(签)
最大值
(签)
最低值
(未签名)
最大值
(未签名)
天音 1个 -128 127 0 255
SMALLINT 2 -32768 32767 65535
中号 3 -8388608 8388607至 0 16777215
INT 4 -2147483648 2147483647 4294967295
比金特 8 -9223372036854775808 92233720368
54775807
184467440737
09551615

INT is one of the most popular types where normal integer values are stored in INT type. INT can hold up to 11 digits where the range is between -2147483648 and 2147483647 if the stored value is signed. If the value is unsigned allowable range is from 0 to 4294967295.

INT是最流行的类型之一,其中普通整数值以INT类型存储。 如果对存储的值进行了签名,则INT最多可以保留11位数字,范围在-2147483648和2147483647之间。 如果该值是无符号的,则允许的范围是0到4294967295。

TINYINT is used to store tiny integer values which can be up to 4 digits. If the tiny integer is signed values between -128 and 127 can be used but it not signed from 0 to 255 can be stored.

TINYINT用于存储微小的整数值,该值最多可以为4位。 如果微小的整数是带符号的,则可以使用-128到127之间的值,但是可以存储0到255之间的无符号值。

SMALLINT is used to store small integer values which can be between -32768 and 32767 for signed integer values. If not signed SMALLINT type can store from 0 to 65535.

SMALLINT用于存储小整数值,对于带符号整数值,小整数值可以在-32768和32767之间。 如果未签名,SMALLINT类型可以存储0到65535。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值