- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
SQL语句对一些表与字段的基本操作及提高、技巧(国外英文资料)
SQL语句对一些表与字段的基本操作及提高、技巧(国外英文资料)
A basis,
Note: create a database
The CREATE DATABASE DATABASE - name
Note: delete the database
The drop database dbname
3, note:
The backup of SQL server
- create the device that backs up the data
USE the master
EXEC sp_addumpdevice disk, testBack, c: mssql7backupmynwind_1.dat
- - start backing up
BACKUP the DATABASE pubs TO testBack
Explanation: create a new table
Create table tabname (col1 type1 [not null], col2 type2 [not null],..)
Create a new table based on the existing table:
A: create table tab_new like tab_old (using the old table to create A new table)
B: create table tab_new as select col1, col2... The from tab_old definition only
Note: delete the new table
Drop table tabname
6, note:
Add a column: Alter table tabname add column col type
Note: the column will not be deleted when added. The column and the data type in DB2 are not changed, and the only thing that can change is the length of the varchar type.
7, note:
Add primary key: Alter table tabname add primary key (col)
Explanation: delete the primary key: Alter table tabname drop primary key (col)
8, description:
Create the index: create [unique] index idxname on tabname (col...)
Delete the index: drop index idxname
Note: indexes are immutable and want to change must be deleted.
9, description:
Create the view: create view viewname as the select statement
Delete view: drop view view name
Note: a few simple basic SQL statements
Select * from table1 where scope
Insert into table1 (field1, field2) values (value1, value2)
Delete: delete from table1 where scope
Update: update table1 set field1 = value1 where scope
Search: select * from table1 where field1 like % value1 % - like syntax is subtle, check the information!
Select * from table1 order by field1, field2 [desc]
Total: select count as totalcount from table1
Sum: select sum (field1) as sumvalue from table1
Average: select avg (field1) as avgvalue from table1
Maximum: select Max (field1) as maxvalue from table1
Minimum:
您可能关注的文档
- JavaScript 获取客户端计算机硬件及系统信(国外英文资料).doc
- Java开发实战经典(目录)(国外英文资料).doc
- java开发手机浏览器 最基本的功能(国外英文资料).doc
- java计算器代码(国外英文资料).doc
- java读取数据库字段和值(国外英文资料).doc
- java选择题练习附答案(国外英文资料).doc
- java错误代码含义(国外英文资料).doc
- Java面向对象编程练习题(国外英文资料).doc
- java题目和答案(国外英文资料).doc
- jdpl的使用(国外英文资料).doc
- sql语句提高(国外英文资料).doc
- SSL与数位认证(国外英文资料).doc
- SQL Server数据库入门学习总结_MsSql_(国外英文资料).doc
- STM32F10XPWM输出程序(国外英文资料).doc
- stc89c52单片机定时器实现按键长按识别问题(国外英文资料).doc
- STM32F单纯的TIM2定时器溢出中断试验程序(国外英文资料).doc
- Source Insight3 中文显示修正及键盘困扰(国外英文资料).doc
- STM8gpio配置实用笔记(国外英文资料).doc
- STOCC管理制度在大型火力发电机组建设中的应用(国外英文资料).doc
- STM8S103 PWM实例(国外英文资料).doc
最近下载
- 面向2025年商业银行的金融科技人才金融科技产品运营能力培养策略.docx
- 【50页PPT】数据治理平台与数据运营体系建设方案.pptx VIP
- E5071B网络分析仪指导书.pdf VIP
- 汽车售后经理年终总结.pptx VIP
- 操作考核标准:简易呼吸气囊.pdf VIP
- 高标准基本农田建设项目竣工验收报告.docx VIP
- 人力资源控制程序.doc VIP
- 2020年美工理论题库4.docx VIP
- 国标图集05s502图集阀门井-国家建筑标准设计图集电子版下载 1.docx VIP
- 第2讲 一心跟着共产党(第一课时)没有共产党就没有新中国(课件)-《学生读本(小学低年级)》.pptx VIP
文档评论(0)