当前位置:网站首页>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、小结和选择建议
附加:
边栏推荐
- Programmers exposed that they took private jobs: they took more than 30 orders in 10 months, with a net income of 400000
- 自动控制原理快速入门+理解
- Flutter reports an error no mediaquery widget ancestor found
- selenium 元素交互
- LVGL 8.2 List
- flutter 报错 No MediaQuery widget ancestor found.
- Luo Gu - some interesting questions
- Yyds dry goods inventory # solve the real problem of famous enterprises: continuous maximum sum
- 夜天之书 #53 Apache 开源社群的“石头汤”
- EventBridge 在 SaaS 企业集成领域的探索与实践
猜你喜欢
MySQL组合索引(多列索引)使用与优化案例详解
Five minutes of machine learning every day: why do we need to normalize the characteristics of numerical types?
深度学习 神经网络案例(手写数字识别)
C1 certification learning notes 3 -- Web Foundation
IO flow: node flow and processing flow are summarized in detail.
每周招聘|高级DBA年薪49+,机会越多,成功越近!
Who the final say whether the product is good or not? Sonar puts forward performance indicators for analysis to help you easily judge product performance and performance
When synchronized encounters this thing, there is a big hole, pay attention!
Analysis of nearly 100 million dollars stolen and horizon cross chain bridge attacked
都在说DevOps,你真正了解它吗?
随机推荐
Memory management summary
What are the concepts of union, intersection, difference and complement?
Align left and right!
Implementation of web chat room
Five minutes of machine learning every day: how to use matrix to represent the sample data of multiple characteristic variables?
Numpy notes
自动控制原理快速入门+理解
Width accuracy
CentOS 6.3 下 PHP编译安装JSON模块报错解决
How to match chords
Summer Review, we must avoid stepping on these holes!
Redis的4种缓存模式分享
力扣刷题01(反转链表+滑动窗口+LRU缓存机制)
Redis哨兵模式实现一主二从三哨兵
LVGL 8.2 text shadow
进制乱炖
Redis publish and subscribe
音视频技术开发周刊 | 252
They are all talking about Devops. Do you really understand it?
How to handle exceptions in multithreading?