Get the App
SLTechnology News&Howtos  ›  Servers  › 

The difference between drop, delete and truncate

Shulou Source: shulou.com Published: 2022-06-03 10:15:50 12月06日 Update

1. Drop deletes the table directly, and so does the table structure and data.

2. Delete and turncate delete the table, and the table structure is still there

3. Delete can be followed by conditions, and turncate can be followed directly by table names without conditions.

4. Delete deletes data with log, but turncate does not.

5. Delete deletion is inefficient, but it can be rolled back. Turncate deletion is efficient and cannot be rolled back.

Tags: Efficiency data conditions structure logs Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Docker Shulou Tech Info Xiaomi OPPO Reno