当前位置:网站首页>MySQL学习笔记——数据类型(2)
MySQL学习笔记——数据类型(2)
2022-07-04 14:04:00 【默萧756】
目录
6、日期与时间类型
6.1 YEAR类型
6.2 DATE类型
6.3 TIME类型
6.4 DATATIME类型
6.5 TIMESTAMP类型
TIMESTAMP和DATATIME区别
6.6 开发经验
7、文本字符串类型
7.1 CHAR类型
注意:1、一个中文只占一个字符,三个字节
2、INSERT INTO test_char1(c1) VALUES('ab '); 自己添加的空格也会被去除尾部的空格。
7.2 VARCHAR类型
如何选择CHAR或者VARCHAR
7.3 TEST类型
注意:TEST类型使用的时候,自己添加的空格是不会被删去的,因此在使用SELECT CHAR_LENGTH(tx) FORM test_test;的时候,长度会加上自己的空格
开发经验:
8、ENUM类型
1、枚举添加忽略大小写
2、可以使用索引(下标)进行枚举元素的调用
3、没有限制非空的情况下,可以添加NULL
9、SET类型
10、二进制字符串类型
10.1 BINARY和VARBINARY类型
BINAR固定了长度,因此LENGTH就是指定的长度
10. 2 BLOB类型
Blob类型可以用资源类型作为变量。例如img,可以手动插入数据
TEXT和BLOB的使用注意事项:
11、JSON类型
12、空间类型
13、小结和选择建议
附加:
边栏推荐
- Yyds dry goods inventory # solve the real problem of famous enterprises: continuous maximum sum
- [differential privacy and data adaptability] differential privacy code implementation series (XIV)
- LVGL 8.2 keyboard
- 各大主流编程语言性能PK,结果出乎意料
- 如何配和弦
- Openresty current limiting
- Enter the width!
- Openresty redirection
- Partial modification - progressive development
- Weibo and Huya advance into interest communities: different paths for peers
猜你喜欢
关于FPGA底层资源的细节问题
IO flow: node flow and processing flow are summarized in detail.
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
Redis哨兵模式实现一主二从三哨兵
How to handle exceptions in multithreading?
大神详解开源 BUFF 增益攻略丨直播
音视频技术开发周刊 | 252
MP3是如何诞生的?
智能客服赛道:网易七鱼、微洱科技打法迥异
SAIC Maxus officially released its new brand "mifa", and its flagship product mifa 9 was officially unveiled!
随机推荐
找数字
C1 certification learning notes 3 -- Web Foundation
Summer Review, we must avoid stepping on these holes!
韩国AI团队抄袭震动学界!1个导师带51个学生,还是抄袭惯犯
Halcon knowledge: NCC_ Model template matching
Ffmpeg Visual Studio development (IV): audio decoding
Enter the width!
Align left and right!
LVGL 8.2 Line
PLC模拟量输入 模拟量转换FC S_ITR (CODESYS平台)
暑期复习,一定要避免踩这些坑!
When synchronized encounters this thing, there is a big hole, pay attention!
Deep learning neural network case (handwritten digit recognition)
Luo Gu - some interesting questions
微博、虎牙挺进兴趣社区:同行不同路
宽度与对齐
IO flow: node flow and processing flow are summarized in detail.
小数,指数
基于MAX31865的温度控制系统
I plan to teach myself some programming and want to work as a part-time programmer. I want to ask which programmer has a simple part-time platform list and doesn't investigate the degree of the receiv