当前位置:网站首页>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
边栏推荐
- 微信小程序获取住户地区信息
- Nodemon installation and use
- LeetCode 556. 下一个更大元素 III
- 2311. Longest binary subsequence less than or equal to K
- Deep understanding of C language pointer
- [ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
- Applet (subcontracting)
- LeetCode 31. Next spread
- mysql安装配置以及创建数据库和表
- [technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
猜你喜欢
Composition of applet code
初识结构体
Deep understanding of C language pointer
Applet customization component
A keepalived high availability accident made me learn it again
Applet global style configuration window
Lepton 无损压缩原理及性能分析
Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
随机推荐
notepad++
Deep understanding of C language pointer
It's too difficult to use. Long articles plus pictures and texts will only be written in short articles in the future
Blogger article navigation (classified, real-time update, permanent top)
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Shutter uses overlay to realize global pop-up
Uni app implements global variables
Lepton 无损压缩原理及性能分析
OpenGL - Lighting
Greendao reported an error in qigsaw, could not init daoconfig
Understanding rotation matrix R from the perspective of base transformation
Kotlin introductory notes (I) kotlin variables and non variables
c语言指针深入理解
VS Code问题:长行的长度可通过 “editor.maxTokenizationLineLength“ 进行配置
NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
22-07-04 Xi'an Shanghao housing project experience summary (01)
[reading notes] Figure comparative learning gnn+cl
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
高性能Spark_transformation性能