当前位置:网站首页>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
边栏推荐
- 【C语言】动态内存开辟的使用『malloc』
- 如何獲取GC(垃圾回收器)的STW(暫停)時間?
- TDengine ×英特尔边缘洞见软件包 加速传统行业的数字化转型
- 卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
- (1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
- 天龙八部TLBB系列 - 关于包裹掉落的物品
- 宝塔面板MySQL无法启动
- Are databases more popular as they get older?
- Apache DolphinScheduler 系统架构设计
- Getting started with Apache dolphin scheduler (one article is enough)
猜你喜欢
移动端异构运算技术-GPU OpenCL编程(进阶篇)
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
Community group buying has triggered heated discussion. How does this model work?
百度智能小程序巡检调度方案演进之路
Develop and implement movie recommendation applet based on wechat cloud
Solve liquibase – waiting for changelog lock Cause database deadlock
.Net之延迟队列
Small program startup performance optimization practice
Kotlin Compose 多个条目滚动
TDengine ×英特尔边缘洞见软件包 加速传统行业的数字化转型
随机推荐
Viewpager pageradapter notifydatasetchanged invalid problem
【C语言】动态内存开辟的使用『malloc』
How to correctly evaluate video image quality
历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
Cent7 Oracle database installation error
Optimize database queries using the cursor object of SQLite
Tongweb set gzip
The essence of persuasion is to remove obstacles
Baidu app's continuous integration practice based on pipeline as code
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
百度智能小程序巡检调度方案演进之路
[C language] the use of dynamic memory development "malloc"
On July 2, I invite you to TD Hero online press conference
What should we pay attention to when developing B2C websites?
How to use sqlcipher tool to decrypt encrypted database under Windows system
. Net delay queue
Theme. AppCompat. Light. Darkactionbar not found
Windows uses commands to run kotlin
Comparison of batch merge between Oracle and MySQL
Apache dolphin scheduler system architecture design