Delete is a Data Manipulation Language command, DML command and is used to remove tuples/records from a relation/table. Whereas Drop is a Data Definition Language, DDL command and is used to remove named elements of schema like relations/table, constraints or entire schema.
Following are the important differences between Delete and Drop.
Key | DELETE | DROP |
---|---|---|
Purpose | DELETE Command, removes some or all tuples/records from a relation/table | DROP Command, removes named elements of schema like relations/table, constraints or entire schema. |
Language | DELETE is DML. | DROP is DDL. |
Clause | Where clause is used to add filtering. | No where clause is available. |
Rollback | Delete command can be rollbacked as it works on data buffer. | Drop command can’t be rollbacked as it works directly on data. |
Memory Space | Table memory space is not free if all records are deleted using Delete Command. | Drop command frees the memory space. |
Problem | DELETE command may face shortage of memory. | DROP Command may cause memory fragmentation. |
Interaction | SQL directly interacts with database server. | PL/SQL does not directly interacts with database server. |
Orientation | SQL is data oriented language. | PL/SQL is application oriented language. |
Objective | SQL is used to write queries, create and execute DDL and DML statments. | PL/SQL is used to write program blocks, functions, procedures, triggers and packages. |