<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            oracle數據庫面試題

            時間:2024-10-22 14:41:04 面試筆試 我要投稿
            • 相關推薦

            oracle數據庫面試題

              oracle Certification Program (OCP認證)的面試題目

            oracle數據庫面試題

              (1) A 表中有100條記錄.

              Select * FROM A Where A.COLUMN1 = A.COLUMN1

              這個語句返回幾條記錄? (簡單吧,似乎1秒鐘就有答案了:) 100條

              (2) Create SEQUENCE PEAK_NO

              Select PEAK_NO.NEXTVAL FROM DUAL --> 假設返回1

              10秒中后,再次做

              Select PEAK_NO.NEXTVAL FROM DUAL --> 返回多少? 2

              (3) SQL> connect sys as sysdba

              Connected.

              SQL> into dual values ( Y);

              1 row created.

              SQL> commit;

              Commit complete.

              SQL> select count(*) from dual;

              COUNT(*)

              ----------

              2

              SQL> from dual;

              commit;

              -->DUAL里還剩幾條記錄? 1條

              JUST TRY IT

              一些高難度的SQL面試題

              以下的null代表真的null,寫在這里只是為了讓大家看清楚

              根據如下表的查詢結果,那么以下語句的結果是(知識點:not in/not exists+null)

              SQL> select * from usertable;

              USERID USERNAME

              ----------- ----------------

              1 user1

              2 null

              3 user3

              4 null

              5 user5

              6 user6

              SQL> select * from usergrade;

              USERID USERNAME GRADE

              ---------- ---------------- ----------

              1 user1 90

              2 null 80

              7 user7 80

              8 user8 90

              執行語句:

              select count(*) from usergrade where username not in (select username from usertable);

              select count(*) from usergrade g where not exists

              (select null from usertable t where t.userid=g.userid and t.username=g.username);

              結果為:語句1( 0 ) 語句2 ( 3 )

              A: 0 B:1 C:2 D:3 E:NULL

              2

              在以下的表的顯示結果中,以下語句的執行結果是(知識點:in/exists+rownum)

              SQL> select * from usertable;

              USERID USERNAME

              ----------- ----------------

              1 user1

              2 user2

              3 user3

              4 user4

              5 user5

              SQL> select * from usergrade;

              USERNAME GRADE

              ---------------- ----------

              user9 90

              user8 80

              user7 80

              user2 90

              user1 100

              user1 80

              執行語句

              Select count(*) from usertable t1 where username in

              (select username from usergrade t2 where rownum <=1);

              Select count(*) from usertable t1 where exists

              (select x from usergrade t2 where t1.username=t2.username and rownum <=1);

              以上語句的執行結果是:( ) ( )

              A: 0 B: 1 C: 2 D: 3

              根據以下的在不同會話與時間點的操作,判斷結果是多少,其中時間T1原始表記錄為;

              select * from emp;

              EMPNO DEPTNO SALARY

              ----- ------ ------

              100 1 55

              101 1 50

              select * from dept;

              DEPTNO SUM_OF_SALARY

              ------ -------------

              1 105

              2

              可以看到,現在因為還沒有部門2的員工,所以總薪水為null,現在,

              有兩個不同的用戶(會話)在不同的時間點(按照特定的時間順序)執行了一系列的操作,那么在其中或最后的結果為:

              time session 1 session2

              ----------- ------------------------------- -----------------------------------

              T1 into emp

              values(102,2,60)

              T2 emp set deptno =2

              where empno=100

              T3 dept set sum_of_salary =

              (select sum(salary) from emp

              where emp.deptno=dept.deptno)

              where dept.deptno in(1,2);

              T4 dept set sum_of_salary =

              (select sum(salary) from emp

              where emp.deptno=dept.deptno)

              where dept.deptno in(1,2);

              T5 commit;

              T6 select sum(salary) from emp group by deptno;

              問題一:這里會話2的查詢結果為:

              T7 commit;

              =======到這里為此,所有事務都已完成,所以以下查詢與會話已沒有關系========

              T8 select sum(salary) from emp group by deptno;

              問題二:這里查詢結果為

              T9 select * from dept;

              問題三:這里查詢的結果為

              問題一的結果( ) 問題二的結果是( ) 問題三的結果是( )

              A: B:

              ---------------- ----------------

              1 50 1 50

              2 60 2 55

              C: D:

              ---------------- ----------------

              1 50 1 115

              2 115 2 50

              E: F:

              ---------------- ----------------

              1 105 1 110

              2 60 2 55

              有表一的查詢結果如下,該表為學生成績表(知識點:關聯更新)

              select id,grade from student_grade

              ID GRADE

              -------- -----------

              1 50

              2 40

              3 70

              4 80

              5 30

              6 90

              表二為補考成績表

              select id,grade from student_makeup

              ID GRADE

              -------- -----------

              1 60

              2 80

              5 60

              現在有一個dba通過如下語句把補考成績更新到成績表中,并提交:

              student_grade s set s.grade =

              (select t.grade from student_makeup t

              where s.id=t.id);

              commit;

              請問之后查詢:

              select GRADE from student_grade where id = 3;結果為:

              A: 0 B: 70 C: null D: 以上都不對

              根據以下的在不同會話與時間點的操作,判斷結果是多少,

              其中時間T1

              session1 session2

              -------------------------------------- ----------------------------------------

              T1 select count(*) from t;

              --顯示結果(1000)條

              T2 from t where rownum <=100;

              T3 begin

               from t where rownum <=100;

              commit;

              end;

              /

              T4 truncate table t;

              T5 select count(*) from t;

              --這里顯示的結果是多少

              A: 1000 B: 900 C: 800 D: 0

            【oracle數據庫面試題】相關文章:

            數據庫常見筆試面試題11-11

            Oracle認證11-14

            oracle 技術筆試題02-18

            Oracle筆試,攢RP中02-18

            Oracle筆試,分享筆試內容11-21

            Oracle面試問題 技術篇11-19

            面試題精選02-18

            益和電力Oracle筆試題分享11-21

            分享面試題目 教育職業面試題11-20

            熱門就業行業面試題精選:編輯行業面試題!11-19

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看