GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 24 of 32    Print  
What is the result of the fallowing code?
Piece
Insert into table A value(a1):
CREATE TABLE B AS SELECT * FROM A;
ROLLBACK;

A. Table B gets created with the row inserted in the first statement.
B. Table B is not created
C. Table B gets created, but no row gets inserted into Table A
D. Rollback throws up an exception.


  
Total Answers and Comments: 13 Last Update: June 04, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Vikas Baidya
 

A> Table B gets created with the row inserted in the first statement.
Because all DDL statements are AUTO COMMIT statements and as a create command (a DDL) is issued it is automatically commited and there will not be any effect of rollback....

Vikas Baidya



Above answer was rated as good by the following members:
nishantg29
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
July 28, 2005 09:11:44   #1  
kranti        

RE: What is the result of the fallowing code?PieceInsert into table A value(a1):CREATE TABLE B AS SELECT...
A. Table B gets created with the row inserted in the first statement.
 
Is this answer useful? Yes | No
August 25, 2005 04:24:48   #2  
Debjani        

RE: What is the result of the fallowing code?PieceInsert into table A value(a1):CREATE TABLE B AS SELECT...
Table B gets created but no row gets inserted into Table A
 
Is this answer useful? Yes | No
March 28, 2006 02:13:08   #3  
srinivas        

RE: What is the result of the fallowing code?Piec...
c is the ans:
 
Is this answer useful? Yes | No
April 03, 2006 07:29:08   #4  
JAYESH SAPARIYA        

RE: What is the result of the fallowing code?Piec...

C. Table B gets created but no row gets inserted into Table A

THE TABLE WILL BE CREATED AND ALL THE ROWS ARE INSERTED INTO TABLE B BUT THEN THERE IS ROLLBACK WHICH WILL DELETE ALL THE ROWS.

SO ANS IS C


 
Is this answer useful? Yes | No
April 12, 2006 07:07:08   #5  
pinki        

RE: What is the result of the fallowing code?Piec...

Ans: C

Table B gets created. As the syntax for insert is wrong no rows will be inserted in table 'A'.

syntax for insert: insert into A values(a1);

table and value mentioned in the given piece of code are incorrect.


 
Is this answer useful? Yes | No
May 17, 2006 07:21:45   #6  
Vikas Baidya        

RE: What is the result of the fallowing code?Piec...

A> Table B gets created with the row inserted in the first statement.
Because all DDL statements are AUTO COMMIT statements and as a create command (a DDL) is issued it is automatically commited and there will not be any effect of rollback....

Vikas Baidya


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
May 23, 2006 03:10:09   #7  
Pankaj Srivastava        

RE: What is the result of the fallowing code?Piec...

Table B gets created with the row inserted in the first statement.

Execute This Query :Insert into table A value(a1)

After That Execute this Query


CREATE TABLE B AS SELECT * FROM A;

After Execution of Create Statement. By Default Commit is Executed.

So First & Second Query are commited.


 
Is this answer useful? Yes | No
May 27, 2006 12:45:17   #8  
Jim Abraham        

RE: What is the result of the fallowing code?Piec...
Answer is A as table creation has auto commit after its execution so the rollback wont have any effect on the table
 
Is this answer useful? Yes | No
July 26, 2006 09:15:45   #9  
abhishek        

RE: What is the result of the fallowing code?Piec...

Option (A) is correct as creation of table is ddl operation which is autocommit


 
Is this answer useful? Yes | No
October 25, 2006 04:20:53   #10  
aseemnaithani Member Since: February 2006   Contribution: 10    

RE: What is the result of the fallowing code?Piec...

The answer here is quite simple...

first the insert statement will execute and after that a table b will get created with the data stored in the table a.

There will be no effect of the rollback. the data will get saved in the table a because the DDL commands (create alter etc) fires the commit automatically.


 
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