GeekInterview.com
Series: Subject: Topic:

Oracle Basics Interview Questions

Showing Questions 21 - 40 of 85 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Create a query that will display the total no.Of employees and, of that total, the no.Of employees hired in 1995,1996,1997, and 1998. Create appropriate column headings.

Asked By: Interview Candidate | Asked On: Sep 14th, 2006

Answered by: devarapalli rohini on: Oct 14th, 2011

select * from employees where hiredate in (1995,1996,1997,1998);

Answered by: Prashanth on: Oct 10th, 2011

Exact query you required..... Try it out if you have any doubts.

Code
  1. SELECT count(*),to_char(hire_date,'yyyy') FROM employees WHERE to_char(hire_date,'yyyy') BETWEEN 1995 AND 1998 GROUP BY to_char(hire_date,'yyyy');

Result of max(sysdate) - min(sysdate)

Asked By: Bakshu | Asked On: Feb 27th, 2011

I have some confusion about this question, max(sysdate) - min(sysdate) I think the answer is zero but give some detail description about this.....!

Answered by: Kalpana Mooraka on: Oct 5th, 2011


SQL> select max(sysdate)-min(sysdate) from dual;

MAX(SYSDATE)-MIN(SYSDATE)
-------------------------
0

SQL>

Answered by: Ramesh hurakadli on: Oct 3rd, 2011

result of Max(sysdate)-Min(sysdate),it means, it shows the date which is in between last date n first date of the month according to the system information.

What is the difference between round and trunc function in SQL?

Asked By: GeekAdmin | Asked On: Sep 23rd, 2006

Both truc and round are single value functions. trunc: trunc function truncates that is in other words cuts off to the digits specified. the general syntax of trunc function is: trunc(number, precision); for instance: suppose the value of salary in employee table for ename= ’exforsys’...

Answered by: s.siva karthik on: Sep 29th, 2011

SQL> select ceil(14.1) ,round(14.1),ceil(14.01),round(14.4),trunc(14.6) from dual; CEIL(14.1) ROUND(14.1) CEIL(14.01) ROUND(14.4) TRUNC(14.6) ---------- ----------- ----------- ...

Answered by: avatar on: Sep 10th, 2011

Round function will increase the value by 1 if decimal value is greater than or equal to 5 else it will return same integer value without decimal ex. select round(8.34) from dual; will return 8; sel...

What is mutating error?When we go to mutating error in Oracle?

Asked By: bikshapathi.plsqldeveloper | Asked On: Aug 30th, 2011

Answered by: venugopal on: Sep 25th, 2011

mutating error is nothing but when we update a table at the same time when we retrieve the data from the same table then the mutating table error occurs.......to overcome we use autonomous transaction...

Answered by: Ashritha on: Sep 12th, 2011

it occurs when ever we try to perform either select or dml operations on the same table in the trigger created for same table

Create a query that display the last name,hire date and the day of the week on which the employee started. Label the column day. Order the results by the day of the week starting with monday.Last_name...

Asked By: zecar | Asked On: Sep 12th, 2006

Answered by: sankar babu on: May 25th, 2011

select last_name,hiredate,to_char(hiredate,'day') day

from emp

Answered by: mjennna52 on: Aug 28th, 2010

eg. if use scott/tiger schema:

select ename, TO_CHAR(hiredate, 'DAY') as DAY from emp;

Using which language Oracle is developed?

Asked By: jack_thomas | Asked On: Jul 19th, 2008

Star Read Best Answer

Editorial / Best Answer

Answered by: ACE_GEEK

View all answers by ACE_GEEK

Member Since Jul-2008 | Answered On : Jul 22nd, 2008

"C" ofcourse!!!

Answered by: sirih1 on: May 24th, 2011

Oracle is developed using C and C++

Answered by: matabrez on: Nov 5th, 2010

Till 9i it was developed in using "C" and Java langauge. But from 10g it is fully developed in Java.

Data integrity

Asked By: arunakumaris | Asked On: Mar 22nd, 2010

How does Oracle guarantee data integrity?

Answered by: kperumal75 on: May 4th, 2011

Data Integrity is maintained by Triggers and various other constraints in Oracle.

Answered by: kperumal75 on: May 4th, 2011

Oracle Database enables you to define and enforce each type of data integrity rule defined in the previous section. Most of these rules are easily defined using either integrity constraints or datab...

Catch the error

Asked By: saginandkishore | Asked On: Jun 24th, 2008

SQL>declare 2 dayofweek varchar2(200); 3 begin 4 select to_char(sysdate,'day') into dayofweek from dual ; 5 6 if dayofweek = 'tuesday' 7 then 8 DBMS_output.Put_line('aloha!!! Today is tuesday'); 9 else 10 DBMS_output.Put_line('today is '||to_char(sysdate,'day'));...

Answered by: kperumal75 on: May 2nd, 2011

It should be (sysdate,'day')

Answered by: shri_b on: Mar 12th, 2010

Use

trim(dayofweek) in IF Condition

Locking a user from performing dml operation

Asked By: raut.shubhangi1 | Asked On: Sep 22nd, 2009

Which command is used for locking a user from performing dml operation?

Answered by: ashdba on: Sep 5th, 2010

Revoke insert,update,delete privileges from the user

Answered by: karthikasathya on: Oct 1st, 2009

LOCK TABLE  tablename IN EXCLUSIVE MODE;

EX:
LOCK TABLE emp IN EXCLUSIVE MODE;

Dictionary management tablespaces

Asked By: krishnan J | Asked On: Apr 30th, 2010

How will you change the local management tablespaces into dictionary management tablespaces?

Answered by: dharan415 on: May 26th, 2010

To convert a LMT to DMT,

SQL> exec dbms.space_admin.Tablespace_Migrate_From_local('Tablespace name');

Answered by: hmounir on: May 5th, 2010

By  creating all rollback segments in locally-managed tablespaces.

Tablespace fragmentation

Asked By: arunakumaris | Asked On: Mar 22nd, 2010

How can you prevent tablespace fragmentation? (rebuilding, moving)?

Answered by: vidyajnath on: Apr 23rd, 2010

As rows are added to tables, the table expands into unused space within the space. Conversely, when rows are deleted, a table may coalesce extents, releasing unused space back into the tablespace. As ...

Chained / migrated rows

Asked By: arunakumaris | Asked On: Mar 22nd, 2010

Explain about the chained / migrated rows

Answered by: vidyajnath on: Apr 23rd, 2010

In two circumstances, the data for a row in a table may be too large to fit into a single data block. In the first case, called chaining, the row is too large to fit into an empty data block. In this ...

Oracle background processes

Asked By: arunakumaris | Asked On: Mar 22nd, 2010

Outline the names and function of Oracle background processes

Answered by: vidyajnath on: Apr 23rd, 2010

The Oracle architecture has five mandatory background processes Mandatory background processes: DBWR (Database Writer) PMON (Process Monitor) CKPT (Check Point) LGWR (Log Writer) SMON (System Monitor)...

Oracle segments

Asked By: arunakumaris | Asked On: Mar 22nd, 2010

What are the different types of segments in Oracle?

Answered by: hmounir on: Apr 21st, 2010

Four types of segments are found in an Oracle database:1- Data segment every table in the database resides in a single data segment.2- Index segment each index is stored in its own index segment.3- Te...

Answered by: narendra05 on: Apr 16th, 2010

There are following types of segments in Oracle

1. Data segments stores the data
2. Index segment stores the index data
3. Rollback segment : Stores undo data information for data consistency.


What is the difference between entity and attribute?

Asked By: GeekAdmin | Asked On: Sep 23rd, 2006

To put the definition of an entity is an entity is a single person, place, or thing about which data can be stored. That is in other words for example when one wants to store information about student then it has details like studentno, student name, address for communication, phone number, class of...

Answered by: magedabd on: Apr 10th, 2010

The question is: " is the attribute instance." The attribute itself is not an instance but the value "Exforsys" stored in the attribute is an instance.

Answered by: swathiraj on: Sep 25th, 2006

An entity represents a real world object where as attribut reprsents the characteristics of an entity

Record focus

Asked By: SOOOFT | Asked On: Jan 22nd, 2010

What is the built-in that tells you the record that the user is placed the fouces?

What steps server process has to take to execute an update statement.

Asked By: Rohit Mathur | Asked On: Oct 11th, 2007

Answered by: premk on: Dec 23rd, 2009

When a user issues a update statement the server process checks for weather the same type of command is executed recently or not if that command is executed very recently then it directly proceed to t...

Answered by: ajaymore on: Feb 2nd, 2008

During the execution of an update statement, the server process looks into library cache whether same kind of query is recently executed or not i.e. explain plan is ready for execution or no...

Oracle DBMS pipe commands

Asked By: rudhra97 | Asked On: Jun 9th, 2008

Give the DBMS_pipe commands in Oracle of there execution,which are used to send & recieve messages what is the max size can sent at one go

Star Read Best Answer

Editorial / Best Answer

Answered by: saginandkishore

View all questions by saginandkishore   View all answers by saginandkishore

Member Since Jun-2008 | Answered On : Jun 24th, 2008

dbms_pipe is a IPC methodology which allows processes to communicate with each other using pipes.

The important functions/procedures in this package are

(1) CREATE_PIPE to create a new pipe
==> dbms_pipe.create_pipe(pipename) where pipename can be Oracle supplied or user defined as below

dbms_pipe.create_pipe(dbms_pipe.unique_session_name) -- Creates a PIPE based on your unique Session ID

or

pipename constant varchar2(100) := 'TEST_PIPE';
dbms_pipe.create_pipe(pipename);

(2) Having created the pipes try sending some data through the pipe. To send data prepare the data using dbms_pipe.pack_message(mesg_buf) where mesg_buf can be varchar2, char, number. Basically this procedure is overloaded for Numbers, Varchar2 and date. For long and raw data use the corresponding DBMS_PIPE.PACK_MESSAGE_RAW method. This procedure basically places the data into buffer which can be send on any pipe using the dbms_pipe.send_message(pipename) function.

(3) At the other end of the pipe you can receive the data using dbms_pipe.receive_message function. This functions fetches the data into buffer from where you can unpack the data using dbms_pipe.unpack_message function. This function gets the data in the buffer into a message buffer.

These are the basic commands that you can use for working with pipes. For more details visit oracle documentation.

Answered by: imranbaig.geek on: Dec 1st, 2009

------Funtions------DBMS_PIPE.CREATE_PIPE:- for creating a pipeDBMS_PIPE.SEND_MESSAGE:- For sending messageDBMS_PIPE.REMOVE_PIPE:- for removing messageDBMS_PIPE.RECEIVE_MESSAGE:- For receiving message...

Answered by: saginandkishore on: Jun 24th, 2008

dbms_pipe is a IPC methodology which allows processes to communicate with each other using pipes. The important functions/procedures in this package are(1) CREATE_PIPE to create a new pipe ==> dbms...

System_context

Asked By: raut.shubhangi1 | Asked On: Sep 22nd, 2009

Why is sys_context used for providing privileges in Oracle?

Answered by: reyazan on: Oct 16th, 2009

The sys_context function can be used to retrieve information about the Oracle environment.The syntax for the sys_context function is:sys_context( namespace, parameter, [ length ] )namespace is an Orac...

What is one time procedure

Asked By: hasanvtu | Asked On: Oct 20th, 2006

Answered by: javedans on: Jul 8th, 2009

One time procedure, Its actually not a procedure but its called as one time procedure, Why because this used to initialize variable, calling function or procedure once the scope of package for user se...

Answered by: Thulasidas on: Dec 4th, 2006

And the primary purpose of one time procedure is for one time initialisation of package variables

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.