全文预览

《数据库技术与应用-SQL SERVER2005》刘卫国 熊拥军主编课后习题答案

上传者:读书之乐 |  格式:doc  |  页数:18 |  大小:97KB

文档介绍
,部门名,(基本工资+津贴+奖金-扣除) as 实发工资Р from 职工,部门,工资 where 职工.职工号=工资.职工号 and 职工.部门号=部门.部门号 and 出生日期='1962-10-27'Рselect 职工.职工号,姓名,性别,convert(varchar,出生日期,23) as 出生时间,部门名,(基本工资+津贴+奖金-扣除) as 实发工资Р from 部门 inner join 职工 on 职工.部门号=部门.部门号 inner join 工资 on 职工.职工号=工资.职工号 where 出生日期='1962-10-27'Р--2-3РSELECT 部门名,MIN(出生日期) FROM 部门 JOIN 职工 ON 部门.部门号=职工.部门号 GROUP BY 部门名Р--2-4Рselect 姓名,性别,(year(getdate())-year(出生日期)) as 年龄 from 职工 where (year(getdate())-year(出生日期))>35Р--2-5Рselect 部门名,count(职工号) as 职工人数 from 职工,部门 where 部门.部门号=职工.部门号Р group by 部门名 having count(*)>=2 order by count(*) descРselect 部门名,count(*) as 职工人数 from 职工 inner join 部门 on 部门.部门号=职工.部门号Р group by 部门.部门名 having count(*)>=1 order by count(*) descР第七章索引与视图Р一、选择题РCCADBР二、填空题Р1、alter table, drop indexР2、primary key, uniqueР3、视图Р4、定义Р5、计算列Р6、修改,删除

收藏

分享

举报
下载此文档