GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 75 of 171    Print  
SESSION 1

DELETE FROM EMP;



SESSION 2
SELECT * FROM EMP;
What will be the result?

  
Total Answers and Comments: 13 Last Update: September 28, 2008     Asked by: chiranjeevi reddy 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: kamal
 

Delete is a DML statement so there is no auto commit for delete.

TO answer the question.

Session 1

DELETE FROM EMP;

session 2

SELECT * FROM EMP;

No rows found.

Session 1

Rollback;

Session 2

SELECT * FROM EMP;

12 rows selected.



Above answer was rated as good by the following members:
shiiva
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
February 08, 2006 17:09:57   #1  
kiran        

RE: SESSION 1 ...
no rows found
 
Is this answer useful? Yes | No
February 13, 2006 19:32:37   #2  
l_p_nedunuri Member Since: October 2005   Contribution: 2    

SESSION 1 ...

Hi

When we execute Query DELETE FROM EMP - is going to delete all the rows(DATA). But Structure Remains Same(Structure will not be effacted).

when we execute Query SELECT * FROM EMP -is going to Show the structure.or 0 row(s) affected .

Thank you.


 
Is this answer useful? Yes | No
February 27, 2006 04:25:09   #3  
dhiraj        

RE: SESSION 1 ...

in 1st session

if we fire delete query and in 2nd session if we fire select query then its going to show all the records bcoz after 1st we havent fired commit statement may be i m wrong


 
Is this answer useful? Yes | No
March 01, 2006 04:49:42   #4  
Mainak Aich        

RE: SESSION 1 ...
If we delete the contents of a table and log out then there is an autocommit performed.So although we are not performing commit.A commit is performed automatically by oracle server.So in the next session if we try to select the datas of that table we won't be able to see anything.Thank you.
 
Is this answer useful? Yes | No
March 03, 2006 19:25:12   #5  
kamal        

RE: SESSION 1 ...

Delete is a DML statement so there is no auto commit for delete.

TO answer the question.

Session 1

DELETE FROM EMP;

session 2

SELECT * FROM EMP;

No rows found.

Session 1

Rollback;

Session 2

SELECT * FROM EMP;

12 rows selected.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
March 25, 2006 04:29:31   #6  
dwhprofessional Member Since: March 2006   Contribution: 6    

DIFF B/W QUERIES

WHEN WE SAY DELETE FROM EMP; (say) ALL ROWS WILL BE DELETED AND THEN IF WE SAY SELECT * FROM EMP THEN WE GET NO ROWS SELECTED AS THE TABLE DOESN'T CONTAIN ANY DATA.

AFTER ENTERING THE DELETE COMMAND IF WE SAY ROLLBACK THEN ROLLBACK IS DONE AND NOW IF WE SAY SELECT * FROM EMP NOW ALL ROWS WILL BE DISPLAYED . HOPE U GOT THE ANSWER .

ANYWAY PLZ USERS IF U ARE CONFIDENT OF ANSWERS THEN ONLY POST THE SAME AS LITTLE KNOWLEDGE IS DANGEROUS AS UR JEOPARDING THE LIFE OF THE PEOPLE WHO ARE NEW TO ORACLE OR U HAVE CHANGED THEIR BACKGROUND TO IT PLZ CONFIRM IT OR IF UR SURE THEN POST UR ANSWERS.

THANK YOU


 
Is this answer useful? Yes | No
March 28, 2006 10:54:42   #7  
Nanditha        

RE: SESSION 1 ...

HI dwh Professional

In the question...they have given 2 Statements.Thtz it then din't asked any if statements or allowed to use any other Statement.

They simply asked the result...So this result of those two Queries is We are not going to find any data Except the Sturcture .

Don't comment on others View.

Thank you

-Nanditha


 
Is this answer useful? Yes | No
May 17, 2006 10:50:27   #8  
nileshsingh Member Since: May 2006   Contribution: 12    

RE: SESSION 1 ...
Delete is a DML statement.If all the Data in a table is deleted in 1 session it will not be refelected in Session 2.if it is to be refeleted on 2nd Session we have to COMMIT it 1st in the 1st Session.
 
Is this answer useful? Yes | No
July 06, 2006 09:42:22   #9  
Abhishek        

RE: SESSION 1 ...
Well here we are talking about two different sessions :-If one Session1 deletes all the rows of any table and dosen't fire commit then on the other Session2 user will see all the rows. This is the right answer...
 
Is this answer useful? Yes | No
September 07, 2006 04:14:29   #10  
tdas2004 Member Since: September 2006   Contribution: 5    

RE: SESSION 1 ...
abhishek is right
 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

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

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

Page copy protected against web site content infringement by Copyscape