选择SQL query Daquan(SQL查询语句大全)

sql查询语句大全  时间:2021-02-27  阅读:()

SQL query Daquan SQL查询语句大全

SQL statement Daquan, .Txt iron rice bowl true meaning, not ina place to eat a lifetime of rice, but a lifetime towhere thereis rice to eat. It is a piece of shit, also have met shikelangday. So you don't have to worry too much about yourself today.SQL query Daquan

Statement function

1, data operation

Select --retrieve data rows and columns from a database tableInsert -- adding new data rows to a database table

Delete -- deletes rows of data from the database tableUpdate -- update the data in the database table

2, data definition

Create TABLE - create a database table

Drop TABLE -- delete tables from the database

Alter TABLE - modify the database table structure

Create VIEW - create a view

Drop VIEW -- delete views from the database

Create INDEX -- creates an index for the database tableDrop INDEX -- removes indexes from the database

Create PROCEDURE - creates a stored procedure

Drop PROCEDURE -- deletes stored procedures from the databaseCreate TRIGGER - create a trigger

Drop TRIGGER -- removes triggers from the database

Create SCHEMA -- add a new schema to the database

Drop SCHEMA -- deletes a schema from the database

Create DOMAIN - creates a data range

Alter DOMAIN - change domain definitions

Drop DOMAIN -- deletes a domain from the database

3, data control

GRANT - Grant user access rights

DENY - deny user access

REVOKE - relieves user access rights

4, transaction control

COMMIT - end the current transaction

ROLLBACK - aborts the current transaction

SET TRANSACTION- def ines the current transaction data accessfeature

5, programmed SQL

DECLARE -- sets the cursor for the query

EXPLAN -- describes data access plans for queries

OPEN -- retrieve the query results and open a cursor

FETCH -- retrieve a row of query results

CLOSE - close the cursor

PREPARE - prepares SQL statements for dynamic executionEXECUTE - dynamically executing SQL statements

DESCRIBE -- describes the prepared query

6, local variables

Declare @id char (10)

--set @id =' 10010001'

Select @id =' 10010001'

7, global variables

- must be at the beginning of @ @8, IF statement

Declare, @x, int, @y, int, @z, intSelect @x = 1, @y = 2 @z=3

If @x > @y

Print'x > Y'- print string'x > Y'Else, if, @y > @z

Print'y > z'

Else, print, ' z > Y'

9, CASE statement

Use Pangu

Update employee

Set e_wage =

Case

When job_level = ' 1' then e_wage*1.08

When job_level = '2' then e_wage*1.07

When job_level = '3' then e_wage*1.06

Else e_wage*1.05

End

10, WHILE, CONTINUE, BREAK statement

Declare, @x, int, @y, int, @c, int

Select @x = 1 @y=1

While @x < 3

Begin

Print @x -- print the value of the variable xWhile @y < 3

Begin

Select @c =100*@x+ @y

Print @c -- print the value of the variable C

Select @y = @y + 1

End

Select @x = @x + 1

Select @y = 1

End

11, WAITFOR statement

-wait for 1 hours, 2 minutes, 3 seconds to execute the Selectstatement

WAITFOR DELAY的01:02:03”

从雇员中选择*

——例等到晚上11点零8分后才执行选择语句

等待时间的23:08:00”

从雇员中选择*

12、选择语句

选择* 列名从table_name 表名在column_name算子值例 宿主

SELECT * FROM stock_information哪里StockID中= str NIDs tockname = “str_name”

s tockname像“%发现这%stockname如[A-Za-z] % ---------  [ ]指定值的范围s tockname喜欢[ ^调频] % --------- ^排除指定范围

---------只能在使用像关键字的哪里子句中使用通配符

或stockpath = “stock_path”

或sto cknumb er1000

和股票指数= 24

不stocksex = '人's tocknumber之间的20和100

在sto cknumb er 10、 20、 30

通过StockID中倒序ASC ---------排序 desc -降序 ASC升序由1,2 ---------通过列号秩序stockname = 选择从哪里stockname stock_information StockID中= 4

---------子查询

---------除非能确保内层选择只返回一个行的值

---------否则应在外层哪里子句中用一个在限定符

选择不同的c o lumn_name形式tab l e_name ---------不同指定检索独有的列值不重复

选择s tocknumber “s tocknumber + 10 + 10 = sto cknumb er从t ab l e_n ame

选择stockname “stocknumber” =数*从table_name组s tockname---------组将表按行分组指定列中有相同的值

具有计数* = 2 ---------具有选定指定的组

选择*

从表1表2

在table1. id * = tabl e2. id --------左外部连接表1中有的而表中没有得以空表示table1. id = * table2. id --------右外部连接

选择s tockname从表1

联盟[全部] -----联盟合并查询结果集全保留重复行

选择s tockname从表2

13、插入语句

插入tab l e_names toc k_names toc k_numb er值 “XXX” 、 “XXXX” 值选择stockname stocknumber从stock_tabl e2 ---价值为选择语句

14、更新语句

更新tabl e_name集stockname = “XXX” [ 3 ]在Stock ID中=s tockname =默认stockname = nulls tocknumber = st ockname + 4

15、删除语句

删除从table_name哪里StockID中= 3

截断t ab l e_n ame -----------删除表中所有行仍保持表的完整性表t ab l e_nam e---------------完全删除表

16、 ALTER TABLE *** ---修改数据库表结构

修改表database.owner。

RepriseHosting:$27.97/月-L5640,16G内存,1TB硬盘,10TB月流量,西雅图机房

RepriseHosting是成立于2012年的国外主机商,提供独立服务器租用和VPS主机等产品,数据中心在美国西雅图和拉斯维加斯机房。商家提供的独立服务器以较低的价格为主,目前针对西雅图机房部分独立服务器提供的优惠仍然有效,除了价格折扣外,还免费升级内存和带宽,商家支持使用支付宝或者PayPal、信用卡等付款方式。配置一 $27.97/月CPU:Intel Xeon L5640内存:16GB(原...

wordpress公司网站模板 wordpress简洁高级通用公司主题

wordpress公司网站模板,wordpresss简洁风格的高级通用自适应网站效果,完美自适应支持多终端移动屏幕设备功能,高级可视化后台自定义管理模块+规范高效的搜索优化。wordpress公司网站模板采用标准的HTML5+CSS3语言开发,兼容当下的各种主流浏览器: IE 6+(以及类似360、遨游等基于IE内核的)、Firefox、Google Chrome、Safari、Opera等;同时...

CloudServer:$4/月KVM-2GB/50GB/5TB/三个数据中心

CloudServer是一家新的VPS主机商,成立了差不多9个月吧,提供基于KVM架构的VPS主机,支持Linux或者Windows操作系统,数据中心在美国纽约、洛杉矶和芝加哥机房,都是ColoCrossing的机器。目前商家在LEB提供了几款特价套餐,最低月付4美元(或者$23.88/年),购买更高级别套餐还能三个月费用使用6个月,等于前半年五折了。下面列出几款特别套餐配置信息。CPU:1cor...

sql查询语句大全为你推荐
回收站在哪回收站去哪里了?人人时光机寻时光机歌词eset最新用户名密码eset smart security3.0.621.0最新用户名和密码怎么找ghostxp3GhostXP3电脑公司特别版V499怎么安装百度手写百度如何手写:今日热点怎么删除“今日热点”到底要怎样才能取消弹窗,每次开机都会商标注册查询官网全国商标注册查询在哪里查呀?ios系统iOS系统为什么那么好bluestackbluestacks安卓模拟器有什么用分词技术百度的中文分词原理是什么?与IK分词有区别吗?
根域名服务器 草根过期域名 vps.net 68.168.16.150 sub-process 2017年黑色星期五 好看的桌面背景图片 全站静态化 泉州电信 免费活动 如何安装服务器系统 台湾google 秒杀品 中国电信测速网站 服务器防火墙 atom处理器 lamp的音标 深圳域名 xuni 国外免费云空间 更多