当前位置:网站首页>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、小结和选择建议
附加:
边栏推荐
猜你喜欢
03 storage system
直播预告 | PostgreSQL 内核解读系列第二讲:PostgreSQL 体系结构
Weibo and Huya advance into interest communities: different paths for peers
C1 certification learning notes 3 -- Web Foundation
LeetCode 1200 最小絕對差[排序] HERODING的LeetCode之路
Expose Ali's salary and position level
Ali was laid off employees, looking for a job n day, headhunters came bad news
Guitar Pro 8win10最新版吉他学习 / 打谱 / 创作
Redis 解决事务冲突之乐观锁和悲观锁
Ranking list of databases in July: mongodb and Oracle scores fell the most
随机推荐
Quick introduction to automatic control principle + understanding
[Dalian University of technology] information sharing of postgraduate entrance examination and re examination
重排数组
The performance of major mainstream programming languages is PK, and the results are unexpected
对话龙智高级咨询顾问、Atlassian认证专家叶燕秀:Atlassian产品进入后Server时代,中国用户应当何去何从?
%s格式符
Decimal, exponential
Enter the width!
深度学习 网络正则化
unity update 协程_Unity 协程的原理
关于FPGA底层资源的细节问题
Deep learning network regularization
Helix swarm Chinese package is released, and perforce further improves the user experience in China
Optimization method of deep learning neural network
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
LeetCode 1200 最小絕對差[排序] HERODING的LeetCode之路
go-zero微服务实战系列(九、极致优化秒杀性能)
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
一篇文章搞懂Go语言中的Context
谈SaaS下如何迅速部署应用软件