当前位置:网站首页>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
边栏推荐
- Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
- What should we pay attention to when developing B2C websites?
- Implementation of smart home project
- 剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...
- 一文读懂TDengine的窗口查询功能
- Charm of code language
- 基于单片机步进电机控制器设计(正转反转指示灯挡位)
- View Slide
- [tips] get the x-axis and y-axis values of cdfplot function in MATLAB
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
猜你喜欢
Implementation of smart home project
La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu
高级 OpenCV:BGR 像素强度图
. Net delay queue
Cent7 Oracle database installation error
TDengine 已经支持工业英特尔 边缘洞见软件包
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
Charm of code language
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
双容水箱液位模糊PID控制系统设计与仿真(Matlab/Simulink)
随机推荐
Resolve the horizontal (vertical) sliding conflict between viewpager and WebView
ArcGIS Pro 创建要素
RMS to EAP is simply implemented through mqtt
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
Implementation of smart home project
基于单片机步进电机控制器设计(正转反转指示灯挡位)
Flutter development: use safearea
MySQL数字类型学习笔记
How to implement complex SQL such as distributed database sub query and join?
Cerebral cortex: directed brain connection recognition widespread functional network abnormalities in Parkinson's disease
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
View Slide
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?
盗版DALL·E成梗图之王?日产5万张图像,挤爆抱抱脸服务器,OpenAI勒令改名
百度智能小程序巡检调度方案演进之路
Meitu lost 300 million yuan in currency speculation for half a year. Huawei was exposed to expand its enrollment in Russia. Alphago's peers have made another breakthrough in chess. Today, more big new
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
Node red series (29): use slider and chart nodes to realize double broken line time series diagram