What is the difference between DELETE and TRUNCATE?

Answer Posted / manivasan.s

You cannot TRUNCATE a table that has any foreign key
constraints. You will have to remove the contraints,
TRUNCATE the table, and reapply the contraints.

You can DELETE any row that will not violate a constraint,
while leaving the foreign key or any other contraint in place.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is coalesce in sql?

559


What is rollback?

581


What is equi join in sql?

608


What are the steps for performance tuning.

842


How do I truncate a word?

525






How many types of tables are there?

503


Are subqueries better than joins?

532


How do I count rows in sql query?

491


What does dml mean?

544


What are the differences between in and exists clause?

567


how to concatenate two character strings? : Sql dba

550


Is sql injection illegal?

595


How do I run a sql query in pgadmin 4?

546


Why self join is used in sql?

495


how to create a table index in mysql? : Sql dba

595