Freshers Aptitude technical questions
Freshers Job Alert
Bookmark and Share

Technical Interview Questions
Core Java Java & EJB Oracle Cobol
C with answers C++ .Net Pythin
ASP .Net Ruby Java More...

Technical Questions , Oracle

 

Below are few Oracle related interview questions which is frequently asked in interview.This Oracle interview questions are only meant for Oracle skilled candidates.

Please send us if you have different interview questions.

  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?
  34. To see current user name
    Sql> show user;
  35. Change SQL prompt name
    SQL> set sqlprompt “Manimara > “
    Manimara >
    Manimara >
  36. Switch to DOS prompt
    SQL> host
  37. How do I eliminate the duplicate rows ?
    SQL> delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name);
    or
    SQL> delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv);
    Example.
    Table Emp
    Empno Ename
    101 Scott
    102 Jiyo
    103 Millor
    104 Jiyo
    105 Smith
    delete ename from emp a where rowid < ( select min(rowid) from emp b where a.ename = b.ename);
    The output like,
    Empno Ename
    101 Scott
    102 Millor
    103 Jiyo
    104 Smith
  38. How do I display row number with records?
    To achive this use rownum pseudocolumn with query, like SQL> SQL> select rownum, ename from emp;
    Output:
    1 Scott
    2 Millor
    3 Jiyo
    4 Smith
  39. Display the records between two range
    select rownum, empno, ename from emp where rowid in
    (select rowid from emp where rownum <=&upto
    minus
    select rowid from emp where rownum<&Start);
    Enter value for upto: 10
    Enter value for Start: 7
  40. ROWNUM EMPNO ENAME
    --------- --------- ----------
    1 7782 CLARK
    2 7788 SCOTT
    3 7839 KING
    4 7844 TURNER
  41. I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text “Not Applicable” want to display, instead of blank space. How do I write the query?
  42. SQL> select nvl(to_char(comm.),'NA') from emp;
  43. Output :
  44. NVL(TO_CHAR(COMM),'NA')
    -----------------------
    NA
    300
    500
    NA
    1400
    NA
    NA
  45. Oracle cursor : Implicit & Explicit cursors
    Oracle uses work areas called private SQL areas to create SQL statements.
    PL/SQL construct to identify each and every work are used, is called as Cursor.
    For SQL queries returning a single row, PL/SQL declares all implicit cursors.
    For queries that returning more than one row, the cursor needs to be explicitly declared.
  46. Explicit Cursor attributes
    There are four cursor attributes used in Oracle
    cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN
  47. Implicit Cursor attributes
    Same as explicit cursor but prefixed by the word SQL
  48. SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN
  49. Tips : 1. Here SQL%ISOPEN is false, because oracle automatically closed the implicit cursor after executing SQL statements.
    : 2. All are Boolean attributes.
  50. Find out nth highest salary from emp table
    SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);
  51. Enter value for n: 2
    SAL
    ---------
    3700
  52. To view installed Oracle version information
    SQL> select banner from v$version;
  53. Display the number value in Words
    SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
    from emp;
    the output like,
  54. SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
    --------- -----------------------------------------------------
    800 eight hundred
    1600 one thousand six hundred
    1250 one thousand two hundred fifty
    If you want to add some text like,
    Rs. Three Thousand only.
    SQL> select sal "Salary ",
    (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
    "Sal in Words" from emp
    /
    Salary Sal in Words
    ------- ------------------------------------------------------
    800 Rs. Eight Hundred only.
    1600 Rs. One Thousand Six Hundred only.
    1250 Rs. One Thousand Two Hundred Fifty only.
  55. Display Odd/ Even number of records
    Odd number of records:
    select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
    1
    3
    5
    Even number of records:
    select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
    2
    4
    6
  56. Which date function returns number value?
    months_between
  57. Any three PL/SQL Exceptions?
    Too_many_rows, No_Data_Found, Value_Error, Zero_Error, Others
  58. What are PL/SQL Cursor Exceptions?
    Cursor_Already_Open, Invalid_Cursor
  59. Other way to replace query result null value with a text
    SQL> Set NULL ‘N/A'
    to reset SQL> Set NULL ‘'
  60. What are the more common pseudo-columns?
    SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM
  61. What is the output of SIGN function?
    1 for positive value,
    0 for Zero,
    -1 for Negative value.
  62. What is the maximum number of triggers, can apply to a single table?
    12 triggers.