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
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 |
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 |
What is a table called in database?
Define the relationship between ‘view’ and ‘data independence’.
What is the importance of query in database?
What is an entity-relationship model?
What are the advantages of database software?
What is the use of RECORD option in EXP command ?
Why its better to use files than a DBMS when there are multiple users to access the data
How to use multiple database server in back end ?
Is it good to store image in database?
How to deactivate triggers?
1)what is the difference between view and materilized view? 2)what is the difference between delete and truncate? 3)what is the difference between migration and upgration? 4)what is the difference between RMAN HOT BACKUP and normal hot backup?
what are the differences between an exclusive lock and a shared lock?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)