当前位置:网站首页>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
边栏推荐
- Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上
- H. 265 introduction to coding principles
- Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
- Node red series (29): use slider and chart nodes to realize double broken line time series diagram
- Is it really reliable for AI to make complex decisions for enterprises? Participate in the live broadcast, Dr. Stanford to share his choice | qubit · viewpoint
- RMS to EAP is simply implemented through mqtt
- Develop and implement movie recommendation applet based on wechat cloud
- View Slide
- 观测云与 TDengine 达成深度合作,优化企业上云体验
- Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
猜你喜欢
Kotlin Compose 多个条目滚动
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
解决Navicat激活、注册时候出现No All Pattern Found的问题
Understand the window query function of tdengine in one article
Pagoda panel MySQL cannot be started
Apache DolphinScheduler 入门(一篇就够了)
Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
Community group buying has triggered heated discussion. How does this model work?
如何正确的评测视频画质
一种用于干式脑电图的高密度256通道电极帽
随机推荐
Analysis on the wallet system architecture of Baidu trading platform
(1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
Comment obtenir le temps STW du GC (collecteur d'ordures)?
正式上架!TDengine 插件入驻 Grafana 官网
View Slide
7 月 2 日邀你来TD Hero 线上发布会
[C language] the use of dynamic memory development "malloc"
Resolve the horizontal (vertical) sliding conflict between viewpager and WebView
历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
cent7安装Oracle数据库报错
MySQL character type learning notes
QT realizes signal transmission and reception between two windows
Viewpager pageradapter notifydatasetchanged invalid problem
To bring Euler's innovation to the world, SUSE should be the guide
Apache DolphinScheduler 入门(一篇就够了)
Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on