当前位置:网站首页>MySQL data type
MySQL data type
2022-07-19 08:32:00 【My talented girlfriend】
mysql Data types mainly include :
- value type
- Date and time type
- String type
- value type
value type
Numeric types mainly include integer 、 Floating point and fixed point types .
Integer types
TINYINT、SMALLINT、MEDIUMINT and INT(INTEGER) and BIGINT.
| type | Storage space |
|---|---|
| TINYINT | 1 byte |
| SMALLINT | 2 byte |
| MEDIUMINT | 3 byte |
| INT(INTEGER) | 4 byte |
| BIGINT | 8 byte |
The specified length of integer type is independent of data value , If the specified length exceeds the value range , It can still be inserted correctly
attribute :
- ZEROFILL Appoint , Use characters when the number of digits displayed is not enough 0 fill
- UNSIGNED Integer is an unsigned type
- AUTO_INCREMENT Automatic growth , The default from the 1 Began to increase
Floating point type
float 4 Bytes
double 8 Bytes
Size range (M,D) M Represents the number of decimal and integer digits ,D Represents the number of decimal places
Fixed point number type
DECINAL Fixed-point number , Same as floating point numbers (M,D) , But in the mysql In memory, it is represented by characters , So you can save high-precision numbers .
Date time type
| type | name | byte |
|---|---|---|
| YEAR | year | 1 |
| TIME | Time | 3 |
| DATE | date | 3 |
| DATETIME | Date time | 8 |
| TIMESTAMP | Date time | 4 |
Text string type
| type | length |
|---|---|
| char | length |
| varchar | length +1 |
| tinytext | length +2 |
| text | length +2 |
| mediumtext | length +3 |
| longtext | length +4 |
| enum | 1 or 2 |
| set | 1、2、4 or 8 Bytes |
varchar and char:char It's a fixed length , Insufficient length , Automatic space filling on the right ,varchar It's getting longer .
enum: enumeration , The definition is as follows
create table t(
e enum('a','b','c')
);
Binary string type
bit、bitary、varbinary、tinyblob、tinyblob、blob、mediumblob、longblob
边栏推荐
- Li Kou 43 string multiplication note
- JS学习笔记01-03——this的引用,全局作用域,方法
- Great summary! Finally, someone explained all kinds of SQL join connections clearly
- SPARK闲杂--为什么复用Exchange和subquery
- ansible自动化运维详解(四)ansible中playbook的编写使用、执行命令及实例演示
- 812. Maximum triangle area
- Obtain the home location through IP
- Gateway new generation gateway
- MySQL数据类型
- 65、Restful规范
猜你喜欢

60. Initial knowledge of wsgiref handwritten web framework +jinja2 module

WVPPRO-ZLM-GB21818-摄像头

5g at that time, where will driverless driving go in the future?

Li Kou 43 string multiplication note

A small program about daily habit clock in

46、IO模型

trochvision中数据集的使用

Detailed explanation of ansible automatic operation and maintenance (IV) preparation, use, command execution and example demonstration of playbook in ansible

Snap 1669 combine deux notes de liste

xgen 毛发guide历史被清理解决方法
随机推荐
力扣43字符串相乘笔记
Database write Optimization: database and table segmentation and related issues
Redis publishing and subscription
OpenFeign服务接口调用
Redis introduction
最新一代互联网:WEB 3.0
Understanding of fast and slow pointer
3D激光SLAM:ALOAM---帧间里程计代码解读
MySQL数据类型
Not so large number of combinations
Consul服务注册与发现
Enjoy JVM -- knowledge about GC garbage collection
Redis
JS learning notes 06-08: traversal of arrays and four methods of arrays
如何将读取列表中的str转化为float
RestTemplate
Seaport 以及 ERC-4907 能否成为释放NFT流动性的新途径?| Tokenview
美国压力激增,TikTok 更换全球安全主管
xgen 毛发guide历史被清理解决方法
Classic general pbootcms flower website template source code, adaptive mobile terminal, with background management