![mysql示例数据库](https://i-blog.csdnimg.cn/blog_migrate/7afa26911c43c1deb4e62a300fee8300.png)
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。