by
What is the difference between DELETE and TRUNCATE statements?

1 Answer

0 votes
by

The TRUNCATE command is used to delete all the rows from the table and free the space containing the table.
The DELETE command deletes only the rows from the table based on the condition given in the where clause or deletes all the rows from the table if no condition is specified. But it does not free the space containing the table.

Related questions

0 votes
    What is the difference between DROP and TRUNCATE statements?...
asked Dec 9, 2020 in Technology by JackTerrance
0 votes
    What are the TRUNCATE, DELETE and DROP statements?...
asked Dec 9, 2020 in Technology by JackTerrance
0 votes
    What is the difference between the EXISTS and IN clause in SQL? When should we use EXISTS, and when should we use IN? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    What is the difference between the EXISTS and IN clause in SQL? When should we use EXISTS, and when should we use IN? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Both these joins will give me the same results: SELECT * FROM table JOIN otherTable ON table.ID = ... different SQL implementations? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    Difference between inner and outer join. i am using two table and want to fetch data from both table so which ... can solve our problem Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    What is the difference between UNION and UNION ALL? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    Difference between inner and outer join. i am using two table and want to fetch data from both table so which ... solve our problem. Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    i want to delete the wullfi row by match the authid i must also say the aid is change so cant ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Lets say I have this following table: +------+-------------------------+-- ... JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have a table in Db2 called myTable. It has several columns: a | b | date1 | date2 ----- ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have a table in Db2 called myTable. It has several columns: a | b | date1 | date2 ----- ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have a table in Db2 called myTable. It has several columns: a | b | date1 | date2 ----- ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    I am trying to run the following SQL: INSERT INTO Suppliers ( [SupplierID], [CompanyName]) Select [SupplierID], [ ... is very slow. Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I have a table where I have a ColumnA which has data with white spaces and special characters. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
...