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 a sequence in a database?

0 Answers  


What is difference between database and schema?

0 Answers  


Explain what is a deadlock and mention how it can be resolved?

0 Answers  


What is the use of SET TRANSACTION USE ROLLBACK SEGMENT ?

1 Answers  


How to reorder the table columns (fields)?

0 Answers  






Explain degree of a relation?

0 Answers  


How to specify transaction or query timeout?

0 Answers  


Why rdbms is called relational?

0 Answers  


1. Tell me about your self? 2. Latest Project Introduction? 3. Difference between server jobs and parallel jobs? 4. Seq-Seq Explain its behavior and execution mode and which parallelism technique is used? 5. What is padding characters? 6. Seq-Seq, Seq-Copy-Seq which one is the best and efficient? 7. How many reject links do we have to a transformer? 8. How many reject links to join stage? 9. Difference between join and lookup? 10. How to design PX routine? 11. How can we call job in another job? 12. Difference between batch and sequencer? 13. Which Database is used? 14. What is change capture? Give briefing of that? 15. What is change Code? Explain? 16. How you call UNIX in Ds? 17. How do you call JCL in UNIX? 18. How do you pass the job status of one job to another job? Have designed any job sequencer? 19. How do you find a file in existed directory? 20. How can you call parallel jobs in transformer? 21. Execution of jobs in command line? 22. Tuning of sql queries? 23. What is orchestrating metadata? 24. What are junk dimension? 25. What are the third party tools you are used? 26. What are the system variables you have used? IBM 1. What is virtual dataset? 2. How do you handle reject link to a peek stage? 3. What is transaction table? 4. Which one is the efficient from the following? a. ODBC enterprise b. Oracle enterprise 5. How can you extract data from excel sheet? Do you know how to parameterize, this option? 6. Six pages of complex query I have, how do you simplify this query? 7. Difference between dataset and lookup file set?

0 Answers   IBM,


What happens when my integer identity runs out of scope?

0 Answers  


What is 2nf in database?

0 Answers  


Can we use a Restricted packaged procedure in WHEN_TEXT_ITEM trigger ?

1 Answers  


Categories