What is the difference between DELETE, TRUNCATE, and DROP?

Question

can you help me with this question

Answer ( 1 )

    0
    2025-02-22T06:02:21+00:00
    • DELETE removes specific rows and can be rolled back (WHERE can be used).
    • TRUNCATE removes all rows without logging individual row deletions (faster, cannot be rolled back).
    • DROP removes the entire table structure and data permanently.

    📌 Example:

    DELETE FROM employees WHERE id = 101; -- Can be rolled back
    TRUNCATE TABLE employees;
    -- Deletes all rows, no rollback
    DROP TABLE employees; 

Leave an answer