Oracle SQL and PLSQL Inteview Questions

Hi ALl,

  Can I have a list of very commonly asked SQL and PLSQL Interview QUestions & Answers please....

For Basic SQL:

How do you convert a date to a string? To_char. A bonus would be that they always include a format mask.

What is an aggregate function? I'm looking for "grouping", sums or counts, etc.

What is an interval? Specifies a period of time.

What is a nested subquery? A subquery in a where clause.

What is the dual table? A single row table provided by oracle for selecting values and expressions.

For Basic PL/SQL:

Describe the block structure of PLSQL. Declaration, Begin, exception, end.

What is an anonymous block? Unnamed PL/SQL block.

What is a PL/SQL collection? PL/SQL Table, Varray, PL/SQL Array, etc.

What is the difference between an explicit cursor and a select into. You might get something about performance but that's a myth. An explicit cursor is just more typing. A cursor for loop would be used to return more than a single row.

Why would you choose to use a package versus straight procedures and functions? I look for maintenance, grouping logical functionality, dependency management, etc. I want to believe that they believe using packages is a "good thing".

Who is Participating?
Devinder Singh VirdiLead Oracle DBA TeamCommented:
I believe, you need to be confident and have clear picture of concept.
Which table will you use to see user constraints? Normal question
I want to display data in one line showing Primary Key constraint not matching with child's foreign key.

Not 100% sure, I think this is against the policy of this website to provide that kind of information therefore I am not giving direct answer.

Learn any book and dig more what you can do with that.

Can we call Sqlplus variable from PL/Block
Devinder Singh VirdiLead Oracle DBA TeamCommented:
I want to display data in one line showing Primary Key constraint not matching with child's foreign key INDEX columns ordering.
I haven't had an interview like this in a few years. I'm the one now who sometimes has to help management in interviewing others and you kind of know when people answer certain questions the same way the read it online, so try to stay away from Google or any other search engine, 'cause chances are that the interviewer may have a printout of the same webpage you visited before going to the interview.

Learn Oracle as much as you can and go to the interview with what you know - what if you get the job and then you have no freaking idea how to code?

Try to impress the interviewers but giving them information that they don't have written down in the questionnaire, so you sound smarter than them.

For example, using your last question:

Why would you choose to use a package versus straight procedures and functions?

Instead of mentioning what everyone knows, mention that packages are great because contexts can only be associated with packages and contexts are excellent for database security. Also packages' execution section can initialize the package once per session and any program unit and/or variable in the executable section will be run and/or initialized once per session as well. Then talk about overloading, private global variables, encapsulation, etc, etc.

One quick question that most I have interviewed have failed is:

What's the default value a boolean variable in the declarative section of a program unit?
Naveen KumarProduction Manager / Application Support ManagerCommented:
we need to learn by practising with code examples by writing/executing them to understand how they work as they will put stuff/answers into our heads which stay there for a long time rather than just reading all urls/links/books/forums as they stay for a short span of time.

Do not worry too much about the interview questions as no one in this world knows answers for all oracle questions. i mean prepare yourself with the required learning/skills and face it with confidence :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.