偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

DB2數(shù)據(jù)庫(kù)必須掌握的常用語(yǔ)句(四)

數(shù)據(jù)庫(kù)
DB2數(shù)據(jù)庫(kù)的操作過(guò)程中會(huì)用到很多的專門(mén)語(yǔ)句,可見(jiàn)DB2數(shù)據(jù)庫(kù)常用語(yǔ)句是DB2數(shù)據(jù)庫(kù)的敲門(mén)磚,下面就帶領(lǐng)大家一起去學(xué)習(xí)DB2數(shù)據(jù)庫(kù)常用語(yǔ)句。

之前為大家介紹的DB2數(shù)據(jù)庫(kù)必須掌握的常用語(yǔ)句(三)、DB2數(shù)據(jù)庫(kù)必須掌握的常用語(yǔ)句(二)、DB2數(shù)據(jù)庫(kù)必須掌握的常用語(yǔ)句(一),接下來(lái)為大家介紹更多的有關(guān)DB2數(shù)據(jù)庫(kù)常用語(yǔ)句的知識(shí)。

1、由sales表中查找出訂單金額大于"E0013業(yè)務(wù)員在1996/10/15這天所接每一張訂單的金額"的所有訂單

select *

from sales

where tot_amt>all

(select tot_amt

from sales

where sale_id='E0013'and order_date='1996/10/15')

order by tot_amt

2、計(jì)算'P0001'產(chǎn)品的平均銷售單價(jià)

select avg(unit_price)

from sale_item

where prod_id='P0001'

3、找出公司女員工所接的定單

select sale_id,tot_amt

from sales

where sale_id in

(select sale_id from employee

where sex='F')

4、找出同一天進(jìn)入公司服務(wù)的員工

select a.emp_no,a.emp_name,a.date_hired

from employee a

join employee b

on (a.emp_no!=b.emp_no and a.date_hired=b.date_hired)

order by a.date_hired

5、找出目前業(yè)績(jī)超過(guò)232000元的員工編號(hào)和姓名

select emp_no,emp_name

from employee

where emp_no in

(select sale_id

from sales

group by sale_id

having sum(tot_amt)<232000)

6、查詢出employee表中所有女職工的平均工資和住址在"上海市"的所有女職工的平均工資

select avg(salary)

from employee

where sex like 'f'

union

select avg(salary)

from employee

where sex like 'f' and addr like '上海市%'

7、在employee表中查詢薪水超過(guò)員工平均薪水的員工信息

Select *

from employee

where salary>( select avg(salary)

from employee)

8、 找出目前銷售業(yè)績(jī)超過(guò)10000元的業(yè)務(wù)員編號(hào)及銷售業(yè)績(jī),并按銷售業(yè)績(jī)從大到小排序

Select sale_id ,sum(tot_amt)

from sales

group by sale_id

having sum(tot_amt)>10000

order by sum(tot_amt) desc

9、 找出公司男業(yè)務(wù)員所接且訂單金額超過(guò)2000元的訂單號(hào)及訂單金額

Select order_no,tot_amt

From sales ,employee

Where sale_id=emp_no and sex='M' and tot_amt>2000
 

10、 查詢sales表中訂單金額***的訂單號(hào)及訂單金額

Select order_no,tot_amt from sales

where tot_amt=(select max(tot_amt) from sales)

11、 查詢?cè)诿繌堄唵沃杏嗁?gòu)金額超過(guò)4000元的客戶名及其地址

Select cust_name,addr from customer a,sales b

where a.cust_id=b.cust_id and tot_amt>4000

12、 求出每位客戶的總訂購(gòu)金額,顯示出客戶號(hào)及總訂購(gòu)金額,并按總訂購(gòu)金額降序排列

Select cust_id,sum(tot_amt) from sales

Group by cust_id

Order by sum(tot_amt) desc

【編輯推薦】

  1. DB2數(shù)據(jù)庫(kù)優(yōu)化超有用的幾條基本策略
  2. 實(shí)例之Visual C#中實(shí)現(xiàn)DB2數(shù)據(jù)庫(kù)的編程
  3. DB2數(shù)據(jù)庫(kù)性能監(jiān)控的具體步驟

 

責(zé)任編輯:迎迎 來(lái)源: 天極網(wǎng)
相關(guān)推薦

2011-03-16 10:12:14

DB2數(shù)據(jù)庫(kù)常用語(yǔ)句

2011-03-16 10:19:49

DB2數(shù)據(jù)庫(kù)常用語(yǔ)句

2011-03-16 10:10:39

DB2數(shù)據(jù)庫(kù)常用命令

2011-03-16 10:59:34

DB2數(shù)據(jù)庫(kù)常用語(yǔ)句

2010-11-04 12:00:59

db2存儲(chǔ)過(guò)程

2010-08-09 13:08:45

DB2數(shù)據(jù)庫(kù)

2010-08-10 09:07:51

DB2數(shù)據(jù)庫(kù)優(yōu)化

2010-07-29 09:44:35

DB2數(shù)據(jù)庫(kù)優(yōu)化

2010-11-04 09:31:21

DB2循環(huán)語(yǔ)句

2010-09-06 10:00:00

DB2數(shù)據(jù)庫(kù)

2010-08-25 15:13:22

DB2Oracle數(shù)據(jù)庫(kù)

2010-04-13 15:24:25

Oracle維護(hù)常用語(yǔ)

2011-03-11 16:02:03

DB2數(shù)據(jù)庫(kù)安裝

2011-08-31 16:33:00

DB2

2010-07-27 08:48:52

DB2數(shù)據(jù)庫(kù)優(yōu)化

2010-10-08 10:18:26

MySQL自增字段

2010-11-03 16:32:10

DB2創(chuàng)建數(shù)據(jù)庫(kù)

2011-03-16 13:21:04

IBM DB2數(shù)據(jù)庫(kù)性能參數(shù)

2010-08-31 17:34:46

DB2

2010-11-01 13:45:16

DB2數(shù)據(jù)庫(kù)的優(yōu)勢(shì)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)