热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

学习DB2数据库必须掌握的五十四条常用语句 (3)

来源: 作者: 时间:2008-05-09 Tag: 点击:

26、选取编号界于'C0001'和'C0004'的客户编号、客户名称、客户地址

select CUST_ID,cust_name,addr

from customer

where cust_id between 'C0001' AND 'C0004'

 

27、计算出一共销售了几种产品

select count(distinct prod_id) as '共销售产品数'

from sale_item

 

28、将业务部员工的薪水上调3%

update employee

set salary=salary*1.03

where dept='业务'

 

29、由employee表中查找出薪水最低的员工信息

select *

from employee

where salary=

(select min(salary )

from employee )

 

30、使用join查询客户姓名为"客户丙"所购货物的"客户名称","定单金额","定货日期","电话号码"

select a.cust_id,b.tot_amt,b.order_date,a.tel_no

from customer a join sales b

on a.cust_id=b.cust_id and cust_name like '客户丙' 

最新评论共有 4 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册