当前位置:网站首页>MySQL digital type learning notes
MySQL digital type learning notes
2022-07-05 10:08:00 【51CTO】
Numeric type
Recently in to see 《MySQL Technology insider :SQL Programming 》 And made notes , So this blog is a blog of note type , Share it for your review , Can also help others
- integer
type | Occupancy space | minimum value (SIGNED) | Maximum (SIGNED) | minimum value (UNSIGNED) | Maximum (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 |
- A type of
A type of , Keywords are bit, The bit type is used to store the value of the bit field ,BIT(M),M Indicates the value of the number of bits allowed to be stored ,M For the range of 1 To 64, The space occupied is (M+7)/8 byte
Be careful : If the length of the assigned value is less than M position , Use it on the left of the value 0 fill
# Create a table
CREATE TABLE t(a BIT(4));
# Write data
INSERT INTO t SELECT b'1000';
# Inquire about , Display the string in the new version , You can't check it directly
SELECT * FROM t;
# Bit type , It can be used HEX function , The result is a number 8(16 Base number )
SELECT HEX(a) FROM t;
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- floating-point ( Imprecise type )
MySQL Two floating point types are supported : Single precision FLOAT Type and double precision DOUBLE type - High precision type
DECIMAL and NUMERIC yes MySQL Types with relatively high progress , Grammar is DECIMAL(M,N)、NUMERIC(M,N),M Representation precision , That is, the number of digits of the whole value ,, Two types of maximum digits M All for 65,N Indicates the scale , That is, the number of digits after the decimal point of the whole value
边栏推荐
- 单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
- How to use sqlcipher tool to decrypt encrypted database under Windows system
- idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
- What should we pay attention to when developing B2C websites?
- Common fault analysis and Countermeasures of using MySQL in go language
- Windows uses commands to run kotlin
- tongweb设置gzip
- TDengine 离线升级流程
- Tianlong Babu TLBB series - about items dropped from packages
- 如何正确的评测视频画质
猜你喜欢

What should we pay attention to when entering the community e-commerce business?

剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...

View Slide

Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on

Evolution of Baidu intelligent applet patrol scheduling scheme

从“化学家”到开发者,从甲骨文到 TDengine,我人生的两次重要抉择

Wechat applet - simple diet recommendation (4)

Single chip microcomputer principle and Interface Technology (esp8266/esp32) machine human draft

Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上

历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
随机推荐
idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
Cent7 Oracle database installation error
百度智能小程序巡检调度方案演进之路
Charm of code language
oracle 多行数据合并成一行数据
How to use sqlcipher tool to decrypt encrypted database under Windows system
. Net delay queue
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
Are databases more popular as they get older?
天龙八部TLBB系列 - 关于技能冷却和攻击范围数量的问题
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
Apache DolphinScheduler 入门(一篇就够了)
分布式数据库下子查询和 Join 等复杂 SQL 如何实现?
Kotlin compose multiple item scrolling
高级 OpenCV:BGR 像素强度图
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
Wechat applet - simple diet recommendation (3)
On July 2, I invite you to TD Hero online press conference
写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
TDengine 已经支持工业英特尔 边缘洞见软件包