日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
DB2數(shù)據(jù)庫必須掌握的常用語句(四)

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

成都創(chuàng)新互聯(lián)是一家從事企業(yè)網站建設、成都網站制作、做網站、行業(yè)門戶網站建設、網頁設計制作的專業(yè)網絡公司,擁有經驗豐富的網站建設工程師和網頁設計人員,具備各種規(guī)模與類型網站建設的實力,在網站建設領域樹立了自己獨特的設計風格。自公司成立以來曾獨立設計制作的站點上千余家。

1、由sales表中查找出訂單金額大于"E0013業(yè)務員在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、計算'P0001'產品的平均銷售單價

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、找出同一天進入公司服務的員工

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è)績超過232000元的員工編號和姓名

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表中查詢薪水超過員工平均薪水的員工信息

Select *

from employee

where salary>( select avg(salary)

from employee)

8、 找出目前銷售業(yè)績超過10000元的業(yè)務員編號及銷售業(yè)績,并按銷售業(yè)績從大到小排序

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è)務員所接且訂單金額超過2000元的訂單號及訂單金額

Select order_no,tot_amt

From sales ,employee

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

10、 查詢sales表中訂單金額***的訂單號及訂單金額

Select order_no,tot_amt from sales

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

11、 查詢在每張訂單中訂購金額超過4000元的客戶名及其地址

Select cust_name,addr from customer a,sales b

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

12、 求出每位客戶的總訂購金額,顯示出客戶號及總訂購金額,并按總訂購金額降序排列

Select cust_id,sum(tot_amt) from sales

Group by cust_id

Order by sum(tot_amt) desc

【編輯推薦】

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

網頁名稱:DB2數(shù)據(jù)庫必須掌握的常用語句(四)
文章來源:http://m.5511xx.com/article/cdpehgd.html