当前位置:网站首页>SQL learning alter add new field
SQL learning alter add new field
2022-07-05 09:27:00 【Xu Jiajia 233】
summary
When developers maintain table when , We often encounter the scene of changing the structure of the table .
And that's where it comes in alter.
It should be noted that , Changing table Structure of , If a field is added , Then it needs to pass update To assign values to new fields .
Demo
create table Person (
name string,
age int
);
insert into Person values
("AAA",16),
("BBB",10),
("CCC",20);
sql Code
-- Insert new field
alter table Person add adult boolean;
-- Update data
update Person SET adult=age>=18;
select * from Person;
result
AAA|16|0
BBB|10|0
CCC|20|1
边栏推荐
- Applet data attribute method
- nodejs_ fs. writeFile
- Kotlin introductory notes (V) classes and objects, inheritance, constructors
- A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
- fs. Path module
- LeetCode 556. Next bigger element III
- An article takes you into the world of cookies, sessions, and tokens
- Talking about label smoothing technology
- c语言指针深入理解
- Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
猜你喜欢
A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
LeetCode 556. Next bigger element III
编辑器-vi、vim的使用
Nodejs modularization
Huber Loss
Rebuild my 3D world [open source] [serialization-1]
Confusion matrix
初识结构体
3D reconstruction open source code summary [keep updated]
Applet (use of NPM package)
随机推荐
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Talking about the difference between unittest and pytest
Rebuild my 3D world [open source] [serialization-2]
Rebuild my 3D world [open source] [serialization-1]
Composition of applet code
uni-app---uni.navigateTo跳转传参使用
Principle and performance analysis of lepton lossless compression
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
Applet network data request
Creation and reference of applet
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
OpenGL - Coordinate Systems
Using request headers to develop multi terminal applications
Cloud computing technology hotspot
SMT32H7系列DMA和DMAMUX的一点理解
Nodejs modularization
Applet customization component
Talking about label smoothing technology
3D reconstruction open source code summary [keep updated]
OpenGL - Lighting