oracle数据库面试题,如下,求解!

oracle数据库面试题,如下,求解!,第1张

1

product主键id

顾客表主键acid

商品交易表为联合主键(acid+id),同时acid和id分别是顾客表和商品表的外键

2

select bacname,bacadress

from product a,customer b,order c where aid=cid and bacid=cacid

and aname='李子'

3

select t1acname

from

(select bacname

from product a,customer b,order c where aid=cid and bacid=cacid

and aname='李子') t1,

(select bacname

from product a,customer b,order c where aid=cid and bacid=cacid

and aname='苹果') t2

where t1acname=t2acname

4

select bacname,

sum(case when type='家电' then apricecamount else 0 end) as 家电价格,

sum(case when type='水果' then apricecamount else 0 end) as 水果价格

from product a,customer b,order c where aid=cid and bacid=cacid

group by bacname

考勤信息表

tbl_manualsign

(

ms_id

user_id

ms_time

ms_desc

ms_tag

)

光靠这一个表,不能确定你需要的信息啊。

比如迟到次数,早退次数,还需要知道上下班的时间啊(是固定的值吗)

旷工次数,需要知道哪此是工作日啊(也是固定值,还是按常规算)

再有,每个人上班打一次卡,下班打一次卡(即每人每在在这个表中有2条记录罢)

这些都需要进一步确定。

select bename,bsal from emp b where bsal=any(select asal from emp a where adeptno='30')

select 员工号,工资,部门号,from 表名 where 员工名=SMITH;

查看后如果没有结果,则插入以下数值

insert into 表名(员工名,工资,部门号) values("SMITH",1500,10);

select 雇员 from 表 where 部门=30 union select 姓名,编号,部门 from 表 union select 雇员 from 表 where 薪金>5000 union select 雇员 from 表 where 奖金>01 union select 详细资料,姓名 ,职位 from 表 where 部门=50 and(select 详细资料,姓名,职位 from 表 where 部门=30 and 职位=“经理”) 等依次类推

--平均服务期限(单位为年)

select

deptno,trunc(avg((sysdate-hiredate)/365),0)

"平均工作年限"

from

emp

group

by

deptno;

--不满一年算一年

select

deptno,trunc(avg(trunc((sysdate-hiredate)/365,0)),0)

"平均工作年限"

from

emp

group

by

deptno;

--不满一年不算

以上就是关于oracle数据库面试题,如下,求解!全部的内容,包括:oracle数据库面试题,如下,求解!、在oracle数据库中,员工考勤统计怎么写sql语、在Oracle数据库中,列出薪金等于部门30中员工的薪金的所有员工的姓名和薪金等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9800469.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存