Oracle SQL and PLSQL Inteview Questions

Posted on 2013-01-22
Last Modified: 2013-02-12
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".

Question by:amankhan2005
LVL 35

Assisted Solution

YZlat earned 167 total points
ID: 38807175
LVL 15

Accepted Solution

Devinder Singh Virdi earned 167 total points
ID: 38807280
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
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 38807870
I want to display data in one line showing Primary Key constraint not matching with child's foreign key INDEX columns ordering.
LVL 23

Assisted Solution

paquicuba earned 166 total points
ID: 38808533
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?
LVL 28

Expert Comment

by:Naveen Kumar
ID: 38808637
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 :)

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question