当前位置:网站首页>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表示标度,也就是整个数值小数点后的位数
边栏推荐
- 百度评论中台的设计与探索
- Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
- Node の MongoDB Driver
- Generics, generic defects and application scenarios that 90% of people don't understand
- Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
- On July 2, I invite you to TD Hero online press conference
- ThreadLocal source code learning
- Why do offline stores need cashier software?
- 【两个对象合并成一个对象】
- MySQL字符类型学习笔记
猜你喜欢
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
Design and exploration of Baidu comment Center
移动端异构运算技术-GPU OpenCL编程(进阶篇)
The most comprehensive promotion strategy: online and offline promotion methods of E-commerce mall
Node red series (29): use slider and chart nodes to realize double broken line time series diagram
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
Apache DolphinScheduler 系统架构设计
(1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
使用el-upload封装得组件怎么清空已上传附件
如何获取GC(垃圾回收器)的STW(暂停)时间?
随机推荐
百度智能小程序巡檢調度方案演進之路
如何正确的评测视频画质
Tutorial on building a framework for middle office business system
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
90%的人都不懂的泛型,泛型的缺陷和应用场景
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
搞数据库是不是越老越吃香?
From "chemist" to developer, from Oracle to tdengine, two important choices in my life
Go 语言使用 MySQL 的常见故障分析和应对方法
Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
LeetCode 31. Next spread
Tongweb set gzip
Wechat applet - simple diet recommendation (3)
[200 opencv routines] 219 Add digital watermark (blind watermark)
Design and exploration of Baidu comment Center
【对象数组a与对象数组b取出id不同元素赋值给新的数组】
Project practice | excel export function
为什么不建议你用 MongoDB 这类产品替代时序数据库?
Oracle combines multiple rows of data into one row of data