当前位置:网站首页>Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)
Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)
2022-07-03 22:15:00 【Peach blossom key God】
Database storage data type
Catalog
3 date、time、datetime Date related type
1 numeric Numeric type

-- Create a table ( Field columns use data types )
create table student( id int unsigned auto_increment, name varchar(30),
/* age bigint , You can't write it like that ,bigint It's occupation 8 byte */
age tinyint,
/* Integers can only store integers 18*/
money decimal(10,2),
/* 99999999.99 Maximum number If there is no number, it is 0.00 */
primary key(id) );
-- insert data
insert into student values(null,'jack',18,200);
-- Query data
select * from student;
-- unsigned demonstration
-- age int
-- age int unsigned Unsigned , No negative number , from 0 Start Fast
-- zerofill 0 fill
-- age int(3) zerofill , If you insert a number 1 When querying 001
-- 3 On behalf of the digital 3 Bit width , No 3 digit , If not three , Then fill in the front 0
create table t1( name varchar(30),n1 int, n2 int unsigned, n3 int(3),
/* here 3 No meaning, no effect */
n4 int(5) zerofill);
/* If the content is not enough 5 position , Then fill 0 */
insert into t1 values('jack',1,2,3,4);
select * from t1;
-- jack 1 2 3 00004
insert into t1 values('lisi',-1,0,-3,2342342);
2 string character string

3 date、time、datetime Date related type

4 enum set The compound type

5 bit Boolean

6 json

7 binary Binary system

边栏推荐
- 2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
- Implementation principle of inheritance, encapsulation and polymorphism
- Is it safe and reliable to open an account and register for stock speculation? Is there any risk?
- Nacos common configuration
- Decompile and modify the non source exe or DLL with dnspy
- Cognitive fallacy: Wittgenstein's ruler
- Buuctf, misc: sniffed traffic
- The latest analysis of crane driver (limited to bridge crane) in 2022 and the test questions and analysis of crane driver (limited to bridge crane)
- What indicators should be paid attention to in current limit monitoring?
- What is the content of the securities practice examination?
猜你喜欢
The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation
Summary of basic knowledge of exception handling
Intimacy communication -- [repair relationship] - use communication to heal injuries
Data consistency between redis and database
Correlation
Control loop of program (while loop)
Team collaborative combat penetration tool CS artifact cobalt strike
(5) User login - services and processes - History Du touch date stat CP
Harbor integrated LDAP authentication
BUUCTF,Misc:LSB
随机推荐
Collection | pytoch common loss function disassembly
2022 high altitude installation, maintenance and removal of examination question bank and high altitude installation, maintenance and removal of examination papers
Yyds dry inventory Chapter 4 of getting started with MySQL: data types that can be stored in the data table
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
Sed、Awk
How does sentinel, a traffic management artifact, make it easy for business parties to access?
string
Décompiler et modifier un exe ou une DLL non source en utilisant dnspy
(POJ - 2912) rochambau (weighted concurrent search + enumeration)
6.0 kernel driver character driver
Leetcode problem solving - 235 Nearest common ancestor of binary search tree
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures
使用dnSpy对无源码EXE或DLL进行反编译并且修改
Nacos common configuration
十大券商开户注册安全靠谱吗?有没有风险的?
Common SQL sets
Cesium terrain clipping draw polygon clipping
QGIS grid processing DEM data reclassification
Teach you how to install aidlux (1 installation)
LeetCode 1647. Minimum deletion times of unique character frequency