当前位置:网站首页>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表示标度,也就是整个数值小数点后的位数
边栏推荐
- 百度评论中台的设计与探索
- Why don't you recommend using products like mongodb to replace time series databases?
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
- idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
- How do enterprises choose the appropriate three-level distribution system?
- The most comprehensive promotion strategy: online and offline promotion methods of E-commerce mall
- Design and exploration of Baidu comment Center
- Comment obtenir le temps STW du GC (collecteur d'ordures)?
- TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
- Apache DolphinScheduler 入门(一篇就够了)
猜你喜欢

QT timer realizes dynamic display of pictures

Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?

On July 2, I invite you to TD Hero online press conference

How to use sqlcipher tool to decrypt encrypted database under Windows system

【C语言】动态内存开辟的使用『malloc』

How to correctly evaluate video image quality

Apache DolphinScheduler 入门(一篇就够了)

硬核,你见过机器人玩“密室逃脱”吗?(附代码)

Solve the problem of no all pattern found during Navicat activation and registration

LeetCode 556. Next bigger element III
随机推荐
卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
Are databases more popular as they get older?
TDengine 连接器上线 Google Data Studio 应用商店
Openes version query
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
mysql80服务不启动
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
tongweb设置gzip
如何获取GC(垃圾回收器)的STW(暂停)时间?
【对象数组a与对象数组b取出id不同元素赋值给新的数组】
分布式数据库下子查询和 Join 等复杂 SQL 如何实现?
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
How to empty uploaded attachments with components encapsulated by El upload
Tutorial on building a framework for middle office business system
Theme. AppCompat. Light. Darkactionbar not found
Comment obtenir le temps STW du GC (collecteur d'ordures)?
uni-app---uni. Navigateto jump parameter use
解决Navicat激活、注册时候出现No All Pattern Found的问题