Sie sind auf Seite 1von 9

The columns which are used in the SELECT statement with GROUP BY function are compulsory used

in the GROUP BY clause.


GeekInterview.com

• Home
• Tech Articles
• Code Samples
• Learn
• Freelance Projects
• Online Testing
• Geek Talk
• Job Postings
• Knowledge Base
• Geek Blogs
• Question Bank

Welcome harshdamania | Logout

Top of Form

Search

Bottom of Form
• Interview Questions
• Certification
• Placement Papers
• Tech FAQ
• Career Advice
• Engineering
• Ask Question
GeekInterview.com > Interview Questions > Oracle

Go To First | Previous Question | Next Question


Oracle | Question 2 of 83 Print
When we give SELECT * FROM EMP; How does oracle respond:

Total Answers and Comments: 8 Last Update: October 22, 2009 Asked by: SaratKumar

Sponsored Links

Best Rated Answer



Submitted by: DIPTENDU HUI

Oracle first parsed that SQL then make a execution plan for that which will take minimum CPU I/O
and Memory and internally it's declare a implicit cursor which will return all the record from that
particular table EMP by using set theory of cartesdian product.

Above answer was rated as good by the following members:


ravikumar.drk

October 21, 2005 07:35:13


prathima

RE: When we give SELECT * FROM EMP; How does oracle re...

whenever you want to retrieve all columns data from emp table then you can secify this.
Is this answer useful? Yes | No

November 13, 2005


01:51:29
sudheer

RE: When we give SELECT * FROM EMP; How does oracle re...

when ever we want to see emp table then we will give select*from emp query

Is this answer useful? Yes | No

January 27, 2006 05:48:07


priyadharsiha

Member Since: January 2006 Contribution:

RE: When we give SELECT * FROM EMP; How does oracle re...

It Display the all records of emp table


Is this answer useful? Yes | No

January 28, 2006 07:06:36


DIPTENDU HUI

RE: When we give SELECT * FROM EMP; How does oracle re...

Oracle first parsed that SQL then make a execution plan for that which will take minimum CPU I/O
and Memory and internally it's declare a implicit cursor which will return all the record from that
particular table EMP by using set theory of cartesdian product.

Overall
Is this answer useful? Yes | No
1 0 Rating: +1

February 01, 2007


08:55:53
Parag Sathe

RE: When we give SELECT * FROM EMP; How does oracle re...

This will results as FULL TABLE scan and oracle will return all the columns from this table.

Is this answer useful? Yes | No


May 06, 2008 00:14:36
KAMRANSAJID

Member Since: September 2007 Contribution:

RE: When we give SELECT * FROM EMP; How does oracle respond:

Select command executes and retrieves all of the coulumns values are in table EMP. means you will
see columns name and related data for every column from the table EMP

Is this answer useful? Yes | No

October 20, 2008 23:47:43


rajendra_thanekar

Member Since: April 2007 Contribution: 13

RE: When we give SELECT * FROM EMP; How does oracle respond:

When this query will be submitted to oracle it goes into different stages .ie. parse bind execute and
fetch the result set.

Is this answer useful? Yes | No

October 21, 2009 09:37:09


arifuddin_syd

Member Since: October 2007 Contribution:

RE: When we give SELECT * FROM EMP; How does oracle respond:

Following this as an example let us see how the select execution happens in
database.

SELECT ename sal job FROM emp

WHERE job 'clerk'

ORDER BY sal;

How does the query execution occur?

1. SQL*plus checks the syntax on client side.

2. If syntax is correct the query is stamped as a valid SQL statement and


encrypted into OCI (Oracle Call Interface) packets and sent via LAN using TCP
to the server.

3. Once the packets reach the server the server process will rebuild the
query and again perform a syntax check on server side.

4. Then if syntax is correct SP will continue execution of the query.

5. The SP will go to the library cache. The L.C. will keep the recently
executed SQL statements along with their execution plan.

6. In the library cache the server process will search from the MRU (Most
Recently Used) end to the LRU (Least Recently Used) end for a match for the
SQL statement. It does this by using a hash algorithm that returns a hash
value. If the hash value of the query we have written matches with that of the
query in L.C. Then SP need not generate an execution plan (soft parsing) but
if no match is found then SP has to proceed with the generation of execution
plan (hard parsing).

7. Parsing is the process undertaken by Oracle to generate an execution plan.

8. The first step in parsing involves performing a semantic check. This is


nothing but check for the existence of the obj and its structure in the
database.

9. This check is done by SP in the data dictionary cache. Here SP will ask
for the definition of the object if already available within the DDC SP
will process the check. If not available then SP will retrieve the required
information from the system tablespace.

10. After this SP will approach the optimizer who will read the SQL statement
and generate the execution plan of the query.

11. After generation of the e-plan's the SP will pick the best e-plan and go
to the L.C.

12. SP will keep the e-plan in the L.C. Along with the original SQL text.

13. At this point in time the parsing ends and the execution of the SQL
statement will begin.

14. SP will then go to the database cache and checks whether the data required
by the query is already available or not in the cache.

15. If available that data can be returned to the client else it brings the
data from the database files.

16. If sorting and filtering is required by the query then the PGA is utilized
along with the temporary tablespace for performing sort run.

17. After sort run the data is returned to the client and SQL*plus client will
show the data to the users.

Is this answer useful? Yes | No


Go To Top

Sponsored Links

Related Categories

• Accounting Interview Questions


• Applications
• Clarify CRM Interview Questions
• Object-Orientation Concepts Interview Questions
• Data Warehousing Interview Questions
• Database Interview Questions
• General Interview Questions
• Help Desk Support Interview
• J2EE Interview Questions
• Mainframe Interview Questions
• Management Interviews
• Microsoft Interview Questions
• Networking Interview Questions
• OS Interview Questions
• Oracle Interview Questions
• Oracle Apps Interview Questions
• Peoplesoft Interview Questions
• Programming Interview Questions
• SAP R/3 Interview Questions
• Siebel Interview Questions
• Testing Interview Questions
• Testing Tools Interview Questions and Faqs
• Web Interview Questions

Sponsored Links

About Us - Privacy Policy - Terms and Conditions - Contact - Ask Question - Propose
Category - Site Updates

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Das könnte Ihnen auch gefallen