当前位置:网站首页>MySQL: data types and operators
MySQL: data types and operators
2022-07-28 04:25:00 【_ Soren】
Preface
MySQL The data type defines the size range of the data , Therefore, choose the appropriate type when using , It will not only reduce the disk space occupied by the table , Indirectly reduces the number of disks I/O The number of times , Improved table access efficiency , And the efficiency of index is also closely related to the type of data .
List of articles
data type
value type
When creating a table, it should be based on the scene Choose the appropriate numerical type , Although the type looks similar in byte size , But if there are thousands of pieces of data , It will waste a lot of space .
String type

Be careful : String type CHAR(M), The number in this bracket represents the number of bytes , But sometimes we see this kind of problem ,
Parentheses after integer type :
The memory size occupied by shaping is fixed , Is strongly related to specific types , This 9 Represents the width of integer display .
age INT(9)
Date and time type

The date type is also in the process of doing the project , Frequently used type information , In especial TIMESTAMP and DATETIME Two types , But notice TIMESTAMP Will automatically update the time , It is very suitable for those scenarios that need to record the latest update time , and DATETIME Need to update manually .
Timestamp example :
enum and set
These two types , It is restricted that this field can only take a fixed value , But the enumeration field can only take a unique value , The set field can take any value .
Example : Set gender to a fixed value , If you enter others, you will report an error .
sex enum(‘M’, ‘W’) default ‘M’
Operator
Arithmetic operator

Logical operators

Comparison operator

Wildcard match like: There are two wildcards
%
_
Example :
There are three names :
zhang san
zhang yao
zhangx
select* from where name like ‘zhang%’; // Can match all zhang At the beginning
select* from where name like ‘zhang_’; // Means only match zhang The last character
边栏推荐
- C语言初阶——循环语句(while,for,do while)
- MySQL:数据类型和运算符
- How to select reliable securities analysts?
- 网页源代码查看竟然有这么多方法!你都知道吗?
- How much does it cost to build a self built server for ark survival evolution?
- 虚拟机类加载机制
- The simulation test disconnects the server from the public network
- 【牛客】求1+2+3+...+n
- [record of question brushing] 9. Number of palindromes
- ServletContext、request、response
猜你喜欢

Space complexity calculation super full sorting!! (calculation of hand tearing complexity

Detailed explanation of pl/sql parameters ("box model")

H265/hevc noun explanation -- CTU, CTB, Cu, CB, Tu, PU, TB, Pb, LCU, slice, tile, chroma, luma, I frame, B frame, P frame

MySQL:数据类型和运算符

将数据库拿到的数据渲染到elementUI 中的table中去

Learn regular expressions (regexp)

Study of the Intel aria 10 Avalon mm DMA interface for PCI Express solutions User Guide

IPC: multi process binder Aidl user guide, including cases

XML file usage and parsing

【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5
随机推荐
功耗:Leakage Power
After login, the upper right corner changes to enter the login status
Cookies and session
Learn regular expressions (regexp)
Password key hard coding check
What to do when encountering slow SQL? (next)
Notes to subject 2
[reach out to Party welfare] the easiest way to scan the H5 page in wechat
[coding and decoding] Huffman coding and decoding based on Matlab GUI [including Matlab source code 1976]
Information system project manager (2022) - key content: Information System Security Management (20)
Security exception handling mechanism
Go grpc: a solution of connection reset by peer
The unsatisfied analysis of setup and hold timing is the solution
Regression - linear regression
[record of question brushing] 9. Number of palindromes
【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5
上班摸鱼打卡模拟器微信小程序源码
Kotlin -- function
Kingbasees security guide of Jincang database -- 6.2. Configuration files related to authentication
C语言初阶——循环语句(while,for,do while)