当前位置:网站首页>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

边栏推荐
- 油猴插件
- 十大券商开户注册安全靠谱吗?有没有风险的?
- Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
- Collection | pytoch common loss function disassembly
- Asynchronous artifact: implementation principle and usage scenario of completable future
- js demo 計算本年度還剩下多少天
- treevalue——Master Nested Data Like Tensor
- string
- Plug - in Oil Monkey
- Leetcode problem solving - 230 The k-th smallest element in the binary search tree
猜你喜欢

JS closure knowledge points essence

Décompiler et modifier un exe ou une DLL non source en utilisant dnspy
![[template summary] - binary search tree BST - Basics](/img/78/782129abea06c8e3bef69a121cbce0.jpg)
[template summary] - binary search tree BST - Basics

Nacos common configuration
![[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)](/img/6c/2d48d441fee1981a271319fd9f6c23.jpg)
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
![Intimacy communication -- [repair relationship] - use communication to heal injuries](/img/c2/f10405e3caf570dc6bd124d65b2e93.jpg)
Intimacy communication -- [repair relationship] - use communication to heal injuries

Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?

gslb(global server load balance)技术的一点理解

Yyds dry goods inventory Spring Festival "make" your own fireworks

What indicators should be paid attention to in current limit monitoring?
随机推荐
[SRS] build a specified version of SRS
The White House held an open source security summit, attended by many technology giants
Miscellaneous things that don't miss the right business
Buuctf, web:[geek challenge 2019] buyflag
Uboot migration
Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
[template summary] - binary search tree BST - Basics
1068. Consolidation of ring stones (ring, interval DP)
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
Code in keil5 -- use the code formatting tool astyle (plug-in)
Sed、Awk
Nacos common configuration
Global and Chinese market of gallic acid 2022-2028: Research Report on technology, participants, trends, market size and share
regular expression
What is the content of the securities practice examination?
An expression that regularly matches one of two strings
BUUCTF,Misc:LSB
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures
How to install sentinel console
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)
