ImageVerifierCode 换一换
格式:DOC , 页数:10 ,大小:69KB ,
资源ID:7021547      下载积分:10 金币
验证码下载
登录下载
邮箱/手机:
图形码:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/7021547.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请。


权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4009-655-100;投诉/维权电话:18658249818。

注意事项

本文(oracle部分面试题-DBA数据库管理员JAVA程序员架构师必看.doc)为本站上传会员【xrp****65】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

oracle部分面试题-DBA数据库管理员JAVA程序员架构师必看.doc

1、DBA数据库管理员JAVA程序员架构师必看 面试题一(厦门) Table: (员工emp1) id name 1 a 2 b 3 c 4 d Table:( 性别 sext) id sex 1 男 4 女 5 男 找出忘记填写性别的员工(用 Oracle 的两种方式) select id ,name from emp1 e where e.id not in(select id from sext); select id from emp1 minus select id from sext; select * from emp1

2、e where e.id <> all(select id from sext); select e.* from emp1 e,(select id from emp1 minus select id from sext) s where e.id = s.id; select e.id,e.name from emp1 e,sext s where e.id=s.id(+) and s.sex is null; select * from emp1 left outer join sext on emp1.id = sext.id where sext.sex is null; s

3、elect * from emp1 e where not exists(select * from sext s where e.id = s.id); select * from emp1 where id not in (select emp1.id from emp1, sext where emp1.id = sext.id); select name from emp1 where id not in (select id from emp1 intersect select id from sext); SELECT * FROM emp1 e WHERE (SELECT

4、 COUNT(*) FROM (SELECT id FROM emp1 UNION ALL SELECT id FROM sext) t WHERE t.id = e.id) <2; 面试题二(上海) 表一(AAA) 商品名称 mc 商品总量 sl A 100 B 120 表二(BBB) 商品名称 mc 出库数量 sl A 10 A 20 B 10 B 20 B 30 用一条 Transact-SQL 语句算出商品 A,B 目前还剩多少? select AAA.mc, sl-e.sum_sl as leave from AAA, (select sum

5、sl) sum_sl,mc from BBB group by mc) e where AAA.mc = e.mc Oracle 教程 select AAA.mc,AAA.sl-(select sum(BBB.sl) from BBB where BBB.mc=AAA.mc) from AAA; 面试题三(上海) 人员情况表(employee)中字段包括,员工号(ID),姓名(name),年龄(age),文化程 度(wh):包括四种情况(本科以上,大专,高中,初中以下),现在我要根据年龄字段查 询统计出:表中文化程度为本科以上,大专,高中,初中以下,各有多少人,占总人数多

6、 少。结果如下: 学历 年龄 人数 百分比 本科以上 20 34 14 大专 20 33 13 高中 20 33 13 初中以下 20 100 40 本科以上 21 50 20 。。。。。。 Transact-SQL 查询语句如何写? select wh,age,trunc(count(*)/(select count(*) from employee)*100) from employee group by wh,age; 面试题四(上海) 1. Here's two table STUDENT and SCORE_RANK, write a SQL, li

7、st all student's name who ranks 'A' Table STUDENT COLUMN NAME COLUMN TYPE Comment ID char(9) not nullable Student‟s ID NAME Varchar(30) not nullable Student‟s Name SCORE Int nullable Student‟s score Table SCORE_RANK COLUMN NAME COLUMN TYPE Comment LO_SCORE Int not nullable Low score HI_SCORE

8、Int not nullable High score RANKChar(1) nullable rank Select name from student,score_rank where score between lo_score and hi_score and rank=‟A; 2. Here‟s two table STUDENT and SCORES, a student who have 3 or more courses rank „A‟ is a „GOOD LEARNER‟, write a SQL, list all „GOOD LEARNER‟ „s name

9、 Table STUDENT COLUMN NAME COLUMN TYPE Comment ID char(9) not nullable Student‟s ID NAME Varchar(30) not nullable Student‟s Name Table SCORE COLUMN NAME COLUMN TYPE Comment STUDENT_ID char(9) not nullable Student‟s ID COURSE_ID Int not nullable Course ID SCORE Int not nullable Stuend‟s score

10、 of this course Select name from student,(Select student_id from score,rank where score between lo_score and hi_score and rank=‟A‟ group by student_id having count(course_id)>=3) e where id=e.student_id; 面试题五(福州) 四张表学生表 student(sid,sname), 教师表 teacher(tid,tname), 课程表 course(cid,cn

11、ame,ctype), 选课表 choose_course(ccid,sid,tid,cid) insert into student values(1,'小明'); insert into student values(2,'小花'); insert into teacher values(1,'陈红'); insert into teacher values(2,'陈白'); insert into course values(1,'语文','文科'); insert into course values(2,'数学','理科'); --小明选了陈红老师的语文 in

12、sert into choose_course values(1,1,1,1); --小明选了陈红老师的数学 insert into choose_course values(2,1,1,2); --小花选了陈红老师的数学 insert into choose_course values(3,2,1,2); --小明选了陈白老师的语文 insert into choose_course values(1,1,2,1); --小花选了陈红老师的语文 insert into choose_course values(4,2,1,1); 1.查找陈红老师教的学生是那些? sele

13、ct * from student stu where stu.sid in (select distinct cc.sid from teacher t,choose_course cc where t.tid = cc.tid and t.tname='陈红'); ---------------------------------------------------------- select distinct s.sid,s.sname from teacher t,choose_course cc ,student s t.tid = cc.tid wher

14、e and t.tname='陈红' and s.sid = cc.sid; 2.找学生小明所有的文科老师? select * from teacher where tid in ( select distinct tid from choose_course cc,student s,course c where cc.sid = s.sid and cc.cid = c.cid and s.sname = '小明' and c.ctype = '文科' ); 3.找出没有选修陈红老师的学生 select * from student stu where

15、 stu.sid not in (select cc.sid from teacher t,choose_course cc where t.tid = cc.tid and t.tname='陈红'); 4.教的学生最少的老师? select t.tid,t.tname,t2.cou from teacher t, ( select tid,cou from (select tid,count(distinct sid) cou from choose_course group by tid order by cou) t1 where rownum=1) t2 where

16、 t.tid = t2.tid; ---------------------------------------------- select t.* from teacher t where t.tid = ( select tid from (select tid,count(distinct sid) cou from choose_course group by tid order by cou) t1 where rownum=1); 面试题六(厦门) 8:00--12:00 为迟到, 12:00--18:00 为早退 打卡表 card SQL> cr

17、eate table card( cid number(20), ctime date, cuser number(20)); 人员表 person create table person( pid number(20), name varchar2(10) ) --插入人员表的数据 insert into person values(1,'a'); insert into person values(2,'b'); --插入打卡的数据 insert into card values(1,to_date('20090719080200','yyyymmddhh24m

18、iss'),1); insert into card values(2,to_date('20090719180200','yyyymmddhh24miss'),1); insert into card values(3,to_date('20090719090200','yyyymmddhh24miss'),2); insert into card values(4,to_date('20090719170200','yyyymmddhh24miss'),2); insert into card values(5,to_date('20090720080200','yyyymmdd

19、hh24miss'),1); insert into card values(6,to_date('20090720160200','yyyymmddhh24miss'),1); insert into card values(7,to_date('20090720070200','yyyymmddhh24miss'),2); insert into card values(8,to_date('20090720200200','yyyymmddhh24miss'),2); --分析: 先分组统计出每个人,每天的上班时间和下班时间 即(id,day,mindate,maxdate) se

20、lect p.pid as id, to_char(c.ctime,'yyyymmdd') as day, to_char(min(c.ctime),'hh24mi') as mindate, to_char(max(c.ctime),'hh24mi') as maxdate from card c,person p where c.cuser = p.pid group by p.pid,to_char(c.ctime,'yyyymmdd'); --把上面的分析做成一个视图,判断上班时间是否为迟到 和 下班时间是否为早退 -- 如 果 判 断 前 10 天 的 打 卡 记 录 , 就

21、 改 成 to_char(c.ctime,'yyyymmdd')<=to_char(sysdate-10,'yyyymmdd') select p.name as person_name, e1.day as work_day, e1.mindate as AM, e1.maxdate as PM, --判断迟到 case when e1.mindate between '0800' and '1200' then 'yes' else 'no' end as later, --判断早退 case when e1.maxdate between '1201' an

22、d '1800' then 'yes' else 'no' end as leave_early from --员工表 person p, --上面那张视图表 (select p.pid as id, to_char(c.ctime,'yyyymmdd') as day, to_char(min(c.ctime),'hh24mi') as mindate, to_char(max(c.ctime),'hh24mi') as maxdate from card c,person p where c.cuser = p.pid and to_char(c.ctime,'yyyymm

23、dd')<=to_char(sysdate-1,'yyyymmdd') group by p.pid,to_char(c.ctime,'yyyymmdd') ) e1 where p.pid = e1.id; 面试题七(福州) 删除一张表重复记录(ID 是自增唯一,重复记录:其他字段都是一样) 非常经典的一道面试题(可能存在很多数据,要求性能比较高) 1 louis 20 2 louis 20 3 jimmy 30 4 louis 20 -------------------------------------------------------------

24、 delete from aa where id not in(select min(id) from aa group by name,age); select a1.id from a a1, a a2 where a1.id>a2.id and a1.name=a2.name and a1.age=a2.age and a1.sex=a2.sex 面试题八(福州) 用一条 SQL 语句 查询出每门课都大于 80 分的学生姓名 name 张三 kecheng 语文 fenshu 81 张三 数学 75 李四 语文 76 李四 数

25、学 90 王五 语文 81 王五 数学 100 王五 英语 90 select Distinct name from TEST A Where Not Exists(Select * from TEST Where Name =A.Name And fenshu<=80) select name from test group by name having min(fenshu)>80 select name from test where name not in(select name from test where f

26、ens hu<=80) 面试题九(福州) 有一表 table1 有两个字段 FID,Fno,写一个 SQL 语句列出该表中一个 FID 对应多个不同 的 Fno 的纪录。 类如: 101 1001 101 1001 102 1002 102 1003 103 1004 104 1005 104 1006 105 1007 105 1007 105 1007 105 1008 结果: 102 1002 102 1003 104 1005 104 1006 105 1007 105 1008 select distinct fid

27、fno from table1 where fid in (select fid from table1 group by fid having count(distinct fno)>1) 面试题十(福州) 有员工表 empinfo ( Fempno varchar2(10) not null pk, Fempname varchar2(20) not null, Fage number not null, Fsalary number not null ); 假如数据量很大约 1000 万条;写一个你认为最高效的 SQL,用一个 SQL 计算以下四种人: fsalary

28、>9999 and fage > 35 fsalary>9999 and fage < 35 fsalary<9999 and fage > 35 fsalary<9999 and fage < 35 每种员工的数量; select sum(case when tt.fsalary>9999 and fage > 35 then 1 else 0 end) as "fsalary>9999 and fage > 35", sum(case when tt.fsalary>9999 and fage < 35 then 1 else 0 end) as "fsalary>9999 a

29、nd fage < 35", sum(case when tt.fsalary<9999 and fage > 35 then 1 else 0 end) as "fsalary<9999 and fage > 35", sum(case when tt.fsalary<9999 and fage < 35 then 1 else 0 end) as "fsalary>9999 and fage < 35" from empinfo tt; 面试题十一(上海) 表内容: 2005-05-09 胜 2005-05-09 胜 2005-05-09 负

30、2005-05-09 负 2005-05-10 胜 2005-05-10 负 2005-05-10 负 如果要生成下列结果, 该如何写 sql 语句? 胜 负 2005-05-09 2 2 2005-05-10 1 2 1) select rq, sum(case when shengfu='胜' then 1 else 0 end)'胜',sum(case when shengfu='负' then 1 else 0 end)'负' from #tmp group by rq 3)select a.col001,a.a1 胜,b.b1 负 from (sel

31、ect col001,count(col001) a1 from temp1 where col002='胜' group by col001) a, (select col001,count(col001) b1 from temp1 where col002='负' group by col001) b where a.col001=b.col001 面试题十二(上海) 请用一个 sql 语得出结果 从 table1,table2 中取出如 table3 所列格式数据 table1 月份 mon 部门 dep 业绩 yj ------------------

32、 一月份 01 10 一月份 02 10 一月份 03 5 二月份 02 8 -39- 二月份 04 9 三月份 03 8 table2 部门 dep 部门名称 dname -------------------------------- 01 国内业务一部 02 国内业务二部 03 国内业务三部 04 国际业务部 05 其他部门 table3 (result) 部门 dep 部门名称 一月份 二月份 三月份 -----------------------------------

33、 01 国内业务一部 10 0 0 02 国内业务二部 10 8 0 03 国内业务三部 0 5 8 04 国际业务部 0 0 9 05 其他部门 select a.dep,a.dname sum(case when b.mon='一月份' then b.yj else 0 end) as '一月份', sum(case when b.mon='二月份' then b.yj else 0 end) as '二月份', sum(case when b.mon='三月份' then b.yj else 0 end) as '三月份', from table2 a left join table1 b on a.dep=b.dep 面试题十二(上海) 华为一道面试题 一个表中的 Id 有多个记录,把所有这个 id 的记录查出来,并显示共有多少条记录数。 select id, Count(*) from tb group by id having count(*)>1 -DBA数据库管理员JAVA程序员架构师必看

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服