If I delete a table and then rollback it, do the index on
the table remains?
What if I drop the table and roll back?Do index on the
table remains?
What if I truncate the table and roll back? Do the index on
the table remains

Answers were Sorted based on User's Feedback



If I delete a table and then rollback it, do the index on the table remains? What if I drop the t..

Answer / mohammed

DROP and TRUNCATE are DDL commands, whereas DELETE is a DML
command. Therefore DELETE operations can be rolled back
(undone), while DROP and TRUNCATE operations cannot be
rolled back.It is possible to delete all rows in a table
without deleting the table. This means that the table
structure, attributes, and indexes will be intact.Indexes,
tables, and databases can easily be deleted/removed with
the DROP statement. If we only want to delete the data
inside the table, and not the table itself....
Then, use the TRUNCATE TABLE statement.

Is This Answer Correct ?    6 Yes 2 No

If I delete a table and then rollback it, do the index on the table remains? What if I drop the t..

Answer / dinesh kumar

DDL COMMANDS HAVE AUTO COMMIT ....
DML COMMANDS DOES NOT HAVE AUTO COMMIT FEATURE...
SO IF WE USE "DELETE" THE STRUCTURE AND THE TABLE INDEX ARE NOT DELETD, BUT THE RECORDS ARE DELETED...

NOW IF WE USE "ROLLBACK" ALL THE RECORDS ARE GETTING BACK...

IF WE USE "DROP" ALL THE RECORDS+INDEX+STRUCTURE DELETED.
NOW WE USE "ROLLBACK" NO USE OF IT. BECAUSE AFTER EXECUTING THIS COMMAND SQL ENGINE PERFORMS "COMMIT" OPERATION.

IF WE USE "TRUNCATE" ALL THE RECORDS ARE ONLY DELETED . NOT THE STRUCTURE AND INDEX .. THIS IS ALSO DDL SO SQL ENGINE PERFORMS "COMMIT" OPERATION AFTER EXECUTING THIS COMMAND.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Database Management Interview Questions

What is cliques? What is vdisk and how it will communicate with physical data storage at the time of data retrieval through amp?

0 Answers  


What are indexes? What are b-trees?

0 Answers  


What is database partitioning?

0 Answers  


For a field in a repeating frame, can the source come from a column ?

1 Answers  


How do I create a database?

0 Answers  






What is cold backup and hot backup (in case of oracle)?

0 Answers  


what are the advantages of a client or server model ?

1 Answers  


Can you explain the 'between' clause?

0 Answers  


What is a field in database?

0 Answers  


What you mean by Object Relational DBMS?

0 Answers   Infosys,


Can you drop all the columns of a table ?

0 Answers   MCN Solutions,


How is the pattern matching done in the sql?

0 Answers  


Categories