SQL增删改语句常用
2024-10-18 23:29:29
创建table: create table tab_name( col1 type; 约束:主键-外键-非空-检查-唯一 col2 type; ); 删除表 : drop table tab_name ; 增加列:alter table tab_name add col5 type default null ; 删除列:alter table tab_name drop col5 ; 修改列属性:alter table tab_name modify(col1 type ); 修改列约束:alter table tab_name add primary key /unique(col1,col2,…); alter table tab_name add foreign key (col1) references tab_name(col1); alter table tab_name add check (); 删除列约束:alter table tab_name drop constraint constra_name ; 插入内容: insert into tab_name(col1,col2,…) values(’ ’,’ ’ …); 修改现有行: update tab_name set col1=‘ X ’ where col2= ‘Y’; 删除现有行: delete from tab_name where col1=‘X’ ;
最新文章
- 切换“使用被动式FTP”
- Lind.DDD.Domain.IOwnerBehavor对实体的意义
- C语言学习 第四次作业总结
- Keep-Alive 总结
- Codeforces Bubble Cup 8 - Finals [Online Mirror] B. Bribes lca
- Codeforces Round #228 (Div. 2) C. Fox and Box Accumulation(贪心)
- 动态链接库DLL
- 【HDU 5184】 Brackets (卡特兰数)
- K - Ignatius and the Princess IV
- C#编程实践–产假方案优化版
- Javascript基本概念(一)
- 3DES 加密 解密
- [Spark性能调优] 源码补充 : Spark 2.1.X 中 Unified 和 Static MemoryManager
- 实现AutoMapper(1.0版本)
- SQL随记(六)
- git操作+一个本地项目推到github上+注意
- 在centos7 上安装Python3
- Developing Vert.x Modules with Gradle
- Ubuntu安装ssh 与samba
- nginx FastCGI错误Primary script unknown解决办法