数据库期中复习题及部分答案 .pdfVIP

  • 22
  • 0
  • 约1.38万字
  • 约 11页
  • 2023-12-30 发布于中国
  • 举报

1、查找表中所有姓刘的职工的工号,部门,薪水

selectemp_no,emp_name,dept,salary

fromemployee

whereemp_namelike刘%

2、查找所有定单金额高于20000的所有客户编号

selectcust_id

fromsales

wheretot_amt20000

3、查找出职称为经理和职称为职员的女员工的姓名、职称、性别。

selectemp_name,title,sex

fromemployee

wheretitle=经理ortitle=职员andsex=F

4、选取销售数量最多的前5条订单订单号、数量。

selecttop5withtiesorder_no,sup_id,qty

fromsale_item

orderbyqtydesc

5、按部门进行汇总,统计每个部门的总工资

selectdept,sum(salary)

fromemployee

groupbydept

6、由employee表中查找出薪水最高的员工信息。

select*

fromemployee

wheresalary=

(selectmax(salary)

fromemployee)

7、由sales表中查找出订单金额大于“E0013业务

文档评论(0)

1亿VIP精品文档

相关文档