Which SQL command removes all rows from a table but keeps the table structure, usually faster than DELETE?
Correct answer
D. TRUNCATE
16 views
D. TRUNCATE
16 views
TRUNCATE deallocates the data pages, keeping the table and resetting AUTO_INCREMENT in MySQL. DROP deletes the whole table, and DELETE removes rows one by one and can use a WHERE clause.
Asked in: GATE CS, NTS, PPSC, FPSC
Not sure why the answer is D? Ask here and get an explanation.