当前位置:网站首页>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、小结和选择建议

附加:
边栏推荐
- LVGL 8.2 Line wrap, recoloring and scrolling
- Halo effect - who says that those with light on their heads are heroes
- 音视频技术开发周刊 | 252
- Exploration and practice of eventbridge in the field of SaaS enterprise integration
- 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
- MP3是如何诞生的?
- flutter 报错 No MediaQuery widget ancestor found.
- Redis 解决事务冲突之乐观锁和悲观锁
- numpy笔记
- Partial modification - progressive development
猜你喜欢
![Leetcode 1200 minimum absolute difference [sort] the way of leetcode in heroding](/img/4a/6763e3fbdeaf9de673fbe8eaf96858.png)
Leetcode 1200 minimum absolute difference [sort] the way of leetcode in heroding

Techsmith Camtasia Studio 2022.0.2屏幕录制软件

Guitar Pro 8win10最新版吉他学习 / 打谱 / 创作

Redis 發布和訂閱
![[differential privacy and data adaptability] differential privacy code implementation series (XIV)](/img/de/c053f376fe90c2697ffc640fab57e8.jpg)
[differential privacy and data adaptability] differential privacy code implementation series (XIV)

Introduction to modern control theory + understanding

go-zero微服务实战系列(九、极致优化秒杀性能)

Details of FPGA underlying resources

Redis publish and subscribe

Introduction to asynchronous task capability of function calculation - task trigger de duplication
随机推荐
Yyds dry goods inventory # solve the real problem of famous enterprises: continuous maximum sum
Introduction to modern control theory + understanding
[local differential privacy and random response code implementation] differential privacy code implementation series (13)
5G电视难成竞争优势,视频资源成中国广电最后武器
numpy笔记
宽度精度
Five minutes per day machine learning: use gradient descent to complete the fitting of multi feature linear regression model
宽度与对齐
Leetcode 1200 minimum absolute difference [sort] the way of leetcode in heroding
开源人张亮的 17 年成长路线,热爱才能坚持
Redis哨兵模式实现一主二从三哨兵
文本挖掘工具的介绍[通俗易懂]
Decimal, exponential
LVGL 8.2 List
Luo Gu - some interesting questions
UFO: Microsoft scholars have proposed a unified transformer for visual language representation learning to achieve SOTA performance on multiple multimodal tasks
Is it safe to open an account online for stock speculation? Will you be cheated.
IO流:节点流和处理流详细归纳。
如何配和弦
C1 certification learning notes 3 -- Web Foundation