当前位置:网站首页>MySQL数字类型学习笔记
MySQL数字类型学习笔记
2022-07-05 09:38:00 【51CTO】
数字类型
最近在看《MySQL技术内幕:SQL编程》并做了笔记,所以本博客是一篇笔记类型博客,分享出来方便自己复习,也可以帮助他人
- 整型
类型 | 占用空间 | 最小值(SIGNED) | 最大值(SIGNED) | 最小值(UNSIGNED) | 最大值(UNSIGNED) |
TINYINT | 1 | -128 | 127 | 0 | 255 |
SMALLINT | 2 | -32768 | 32767 | 0 | 65535 |
MEDIUMINT | 3 | -8388608 | 8388607 | 0 | 16777215 |
INT | 4 | -2147483648 | 2147483647 | 0 | 4294967295 |
BIGINT | 8 | -9223372036854775808 | 9223372036854775808 | 0 | 18446744073709551615 |
- 位类型
位类型,关键字是bit,位类型用于存储位字段的值,BIT(M),M表示允许存储位数的值,M的范围为1到64,占用的空间为(M+7)/8字节
注意:如果分配的值长度小于M位,就在数值左边用0填充
- 浮点型(非精确类型)
MySQL支持两种浮点类型:单精度的FLOAT类型和双精度的DOUBLE类型 - 高精度类型
DECIMAL和NUMERIC是MySQL进度比较高的类型,语法都是DECIMAL(M,N)、NUMERIC(M,N),M表示精度,也就是整个数值的位数,,两种类型的最大位数M都为65,N表示标度,也就是整个数值小数点后的位数
边栏推荐
- How to improve the operation efficiency of intra city distribution
- Evolution of Baidu intelligent applet patrol scheduling scheme
- TDengine可通过数据同步工具 DataX读写
- Apache dolphin scheduler system architecture design
- 【对象数组a与对象数组b取出id不同元素赋值给新的数组】
- QT event filter simple case
- 善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
- MySQL installation configuration and creation of databases and tables
- The comparison of every() and some() in JS uses a power storage plan
- How Windows bat script automatically executes sqlcipher command
猜你喜欢

SQL learning - case when then else

Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible

代码语言的魅力
![[200 opencv routines] 219 Add digital watermark (blind watermark)](/img/ac/f6d16e74538bd589a1f6faee08d59a.png)
[200 opencv routines] 219 Add digital watermark (blind watermark)

【OpenCV 例程200篇】219. 添加数字水印(盲水印)

Develop and implement movie recommendation applet based on wechat cloud

cent7安装Oracle数据库报错

Design and exploration of Baidu comment Center

使用el-upload封装得组件怎么清空已上传附件

百度交易中台之钱包系统架构浅析
随机推荐
H.265编码原理入门
idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...
Design and exploration of Baidu comment Center
The essence of persuasion is to remove obstacles
From "chemist" to developer, from Oracle to tdengine, two important choices in my life
宝塔面板MySQL无法启动
What should we pay attention to when entering the community e-commerce business?
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
Are databases more popular as they get older?
硬核,你见过机器人玩“密室逃脱”吗?(附代码)
MySQL installation configuration and creation of databases and tables
90%的人都不懂的泛型,泛型的缺陷和应用场景
What about wechat mall? 5 tips to clear your mind
Oracle combines multiple rows of data into one row of data
E-commerce apps are becoming more and more popular. What are the advantages of being an app?
Node の MongoDB Driver
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
百度智能小程序巡檢調度方案演進之路
uni-app---uni. Navigateto jump parameter use