In SQL, difference between DELETE, TRUNCATE, and DROP?
Using the supplied reference data, write a PostgreSQL query that returns one comparison row for each command and summarizes its behavior.
operation, can_remove_selected_rows, can_remove_all_rows, removes_table_definition, supports_where, and rollback_behavior.DELETE, TRUNCATE, and DROP.DELETE, TRUNCATE, then DROP.| Column | Type | Description |
|---|---|---|
| reference_idPK | INT | Unique reference row identifier |
| operation | VARCHAR(10) | SQL command being described |
| can_remove_selected_rows | BOOLEAN | Whether the command can target selected rows |
| can_remove_all_rows | BOOLEAN | Whether the command removes all table rows |
| removes_table_definition | BOOLEAN | Whether the command removes the table definition |
| supports_where | BOOLEAN | Whether the command supports a WHERE clause |
| rollback_behavior | VARCHAR(30) | Transaction rollback behavior in PostgreSQL |
| reference_note | VARCHAR(140) | Supporting explanation for the reference row |