Oracle interview questions

No answers, but these are useful questions for conducting Oracle interview. The readers are welcome to contribute their answers.

  1. What is an oracle instance?
  2. What is a view?
  3. What is referential integrity?
  4. Name the data dictionary that stores user-defined constraints?
  5. What is a collection of privileges?
  6. What is a snapshot?
  7. What is a synonym?
  8. What is a cursor?
  9. What is a sequence?
  10. What is a trigger?
  11. What is an exception?
  12. What is a partition of table?
  13. What are pseudo-columns in SQL? Provide examples.
  14. What are the Data Control statements?
  15. What is a schema?
  16. What is a type?
  17. What is a data model?
  18. What is a relation?
  19. Advantages of redo log files?
  20. What is an Archiver?
  21. What is a database buffer cache?
  22. What are the background processes in Oracle?
  23. %type and %rowtype are attributes for…?
  24. What are the steps in a two-phase commit?
  25. What is a union, intersect, minus?
  26. What is a join, explain the types of joins?
  27. What is a co-related sub-query?
  28. ODBC stands for…?
  29. Data-type used to work with integers is?
  30. Describe data models?
  31. Describe the Normalization principles?
  32. What are the types of Normalization?
  33. What is de-normalization?
This entry was posted in Database. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

121 Comments on Oracle interview questions

  1. Satyam
    Posted 10/8/2007 at 9:17 am | Permalink

    Hi Chetan,
    Below is the solution for your query.

    select * from (select sum(decode(t2, ‘A’, 1)) A,
    sum(decode(t2, ‘B’, 2)) B,
    sum(decode(t2, ‘C’, 3)) C
    from oemp)

  2. Chetan
    Posted 10/9/2007 at 12:44 pm | Permalink

    Hi,

    Dear Satyam,
    U r really Genies.
    Thanx very very much.
    This query help another also…….
    Pl. give me ur mail id & Fwd on my mailid given above
    Please……

    Regards
    Chetan

  3. Deepak
    Posted 10/25/2007 at 6:43 am | Permalink

    Great satyam,
    But it should be

    select * from (select sum(decode(t2, ‘A’, 1)) A,
    sum(decode(t2, ‘B’, 2)) B,
    sum(decode(t2, ‘C’, 3)) C
    from oemp)

  4. Deepak
    Posted 10/25/2007 at 6:44 am | Permalink

    Great satyam,
    But it should be

    SELECT SUM(A) A,SUM(B) B,SUM(C) C
    FROM
    (
    SELECT DECODE(T2,’A',1) A, DECODE (T2,’B',2) B, DECODE(T2,’C',3) C FROM OEMP
    )

  5. Sanjuda
    Posted 11/4/2007 at 10:26 pm | Permalink

    answer to :
    How to check the rows of a table where anyone column of a table is null? Plz give me the query?

    Thank you Vats, the query I am asking is I am having 3 columns in a table. Now I want the rows in which any one column is null it may be 1 or 2 or 3. Here, I don’t know the columns. How to manipulate the query?

    For Example
    Rownum col1 col2 col3
    1 1 null 2
    2 null 1 null
    3 null null null
    4 1 2 3

    The expected result for me is

    Rownum col1 col2 col3
    1 1 null 2
    2 null 1 null
    3 null null null

    I think this will elaborate more.

    ANSWER::

    SELECT * FROM table_name
    WHERE col1 IS NULL
    OR
    col2 IS NULL
    OR
    col3 IS NULL

  6. Manish
    Posted 11/29/2007 at 9:27 am | Permalink

    I would like to answer the following question:

    What is a database buffer cache?

    Database buffer cache is one of the required SGA component. It caches recent accessed data. It keeps the entry (transaction) in the buffer cache till it is written on the disk (which is done by DBWn background process) at a scheduled time or when ever possible by Oracle. Blocks in database buffer cache can be in the any of the following state: PINNED(it is an active transaction), CLEAN (instance is just started so it is empty or ti has been flushed to the disk and can be reused) , DIRTY (transaction is completed but blocks are waiting to be written on the disk by DBWn).

  7. sourav
    Posted 12/11/2007 at 10:52 pm | Permalink

    I have two tables A & B with one column each.and i am issuing the following statements in a session

    insert into A values(’1′);
    insert into B values(’2′);

    insert into A values(’3′);
    insert into B values(’4′);

    Rollback;

    Now i want data in table B should remain there .it should not be rolled backed?

    How can i acheive this?

  8. sneha priya
    Posted 12/14/2007 at 12:13 pm | Permalink

    hi.
    write a single query to disply only the alphabets from the given pattern below
    “A,C&B$.@D”

  9. alamdar
    Posted 12/20/2007 at 2:05 pm | Permalink

    when do we say >STARTUP MIGRATE?
    what is REGULAR EXPRESSION IN ORACLE DATABASE?
    what is object dependency?

  10. Rekha
    Posted 12/28/2007 at 1:52 am | Permalink

    Sourav,
    To do selective rollback use Savepoints.

    insert into A values(’1′);
    insert into A values(’3′);
    Savepoint A;
    insert into B values(’2′);
    insert into B values(’4′);
    Rollback to A;
    Commit;

  11. Sarika
    Posted 12/28/2007 at 4:13 am | Permalink

    Can you tell me if it is posssible to insert reocrds into a valueset through the backend -oracle? If so how and what will happen as when we enter values through the front-end it automatically goes for compiling hierarchies in the view request window?

  12. raj
    Posted 1/1/2008 at 2:34 am | Permalink

    How can I add a column between two columns (not at the last)

  13. Hassaan Yar Khan
    Posted 1/13/2008 at 7:10 am | Permalink

    The following are table names followed by column names present in it

    emp_company(ename,cname,salary,jdate)
    company(cname,city)
    manager(ename,mname)
    employee(ename,city)
    emp_shift(ename,shift)
    where
    ename=employee name
    cname=company name
    jdate=date of join
    city in employee table means city in which employee resides
    city in company table mean city in which company presents
    mname=manager name
    shift means the time in which employee works

    now please give the queries for the following tasks
    1.give the names of employees living in the same city where their manager is also living
    2.give the salary of manager o0f employees living in city ‘bombay’

    the queries are

    select c.ename,c.mname,c.employee_city,d.city as manager_city
    (
    select a.ename,a.mname,b.city as employee_city
    (select ename,mname from manager)a
    left join
    (select ename,city from employee)b
    on
    a.ename=b.ename
    )
    c
    left join
    (select ename,city from employee)d
    on
    a.mname=b.ename
    where
    c.employee_city=d.city

    Second query is alot easier then this

  14. Hussah
    Posted 5/28/2008 at 11:57 am | Permalink

    What is the difference btw/ a string connection say (ODBC) and a direct connection?

  15. Blossom
    Posted 8/30/2008 at 11:30 am | Permalink

    hi can any1 tel me how to solve these 2 queries
    1.display dptno. wise 1st three highest salaries in ascending order of deptno and descending order of sal
    2.display range of sal wise no. of employees in the diff of rs.999 in the foll. format
    range of sal count
    0 15
    1 17
    2 4
    3 9
    where 0->0-999
    1->1000-1999
    2->2000-2999

  16. bibha
    Posted 10/30/2008 at 10:30 am | Permalink

    hi can any1 tel me how to solve these 2 queries
    1.display dptno. wise 1st three highest salaries in ascending order of deptno and descending order of sal
    2.display range of sal wise no. of employees in the diff of rs.999 in the foll. format
    range of sal count
    0 15
    1 17
    2 4
    3 9
    where 0->0-999
    1->1000-1999
    2->2000-2999

  17. Manjul
    Posted 12/20/2008 at 8:02 am | Permalink

    Ques : in a table’s cloumn we have some positive values and some negative values
    like +30, -40, +60 etc. how i can find the addition of positive values
    and negative values in a single column.

    Ans : this problem can be solved by using decode or case clause

  18. Manjul
    Posted 12/20/2008 at 8:13 am | Permalink

    Ques : Can we update two tables in a single statement? If yes, how?

    Ans : Yes i can
    Example : update act a,concept c set a.action =’vishwanat’ , c.description=’visnth’
    where a.action_id =1 or c.concept_id=1;

  19. Manjul
    Posted 12/20/2008 at 8:56 am | Permalink

    Ques : ques no:116–>hello bibha
    ANS : Select sal,deptno from (select sal,DEPTNO from emp order by sal desc) where rownum < 4;

  20. ruchi
    Posted 12/24/2008 at 12:58 pm | Permalink

    i have a table num
    create table num
    (no number);

    in no column we have 10 values -

    1
    1
    1
    2
    null
    2
    4
    null
    null
    5
    when we write

    select distinct no from num order by no desc;

    output will be
    null
    5
    4
    2
    1

    if null is not equal to null,then why null is shown only once in output ? why not three times.

  21. Latha
    Posted 1/22/2009 at 12:11 pm | Permalink

    I would like to answer the following question:
    in a table’s cloumn we have some positive values and some negative values
    like +30, -40, +60 etc. how i can find the addition of positive values
    and negative values in a single column.

    Answer:
    SELECT SUM(X.POS), SUM(X.NEG)
    FROM
    (SELECT
    (CASE WHEN col1 > 0 then col1 else 0 ENd CASE ) POS
    (CASE WHEN col1 < 0 then col1 else 0 END CASE ) NEG
    FROM
    Tab_name) X

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

viagra online
cialis for sale
cialis 20mg
cialis online