What is the difference between the SQL commands DROP, DELETE and TRUNCATE?DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command DELETE operation is DDL command and DROP and TRUNCATE operations are DML commandsAll three are DML commandsAll three are DDL commands
Question
What is the difference between the SQL commands DROP, DELETE and TRUNCATE?DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command DELETE operation is DDL command and DROP and TRUNCATE operations are DML commandsAll three are DML commandsAll three are DDL commands
Solution
The difference between the SQL commands DROP, DELETE and TRUNCATE is as follows:
-
DROP: This is a Data Definition Language (DDL) command that is used to delete a whole database or just a table.The DROP command removes a table and it cannot be rolled back.
-
DELETE: This is a Data Manipulation Language (DML) command which is used to delete a row in a table. This operation can be rolled back.
-
TRUNCATE: This is a DDL command which is used to delete all the rows from a table. Like the DROP command, this operation also cannot be rolled back.
So, the first statement "DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command" is correct.
Similar Questions
Choose the correct options. __________ command is used to delete the records and _________ command is used to delete the db objects?Select one:Drop ,TruncateDelete , TruncateTruncate , DropTruncate , DeleteClear my choice
Which SQL command is used to delete data from a table?Select one:a. DELETEb. ERASEc. TRUNCATEd. REMOVE
Which of the following statements correctly describe the DELETE operation?1) DROP database [database_name], delete a specific database2) DELETE from [table_name], delete all record from a specific table3) DELETE from [table_name] where [condition], delete a record that meets the condition from a specific table4) DROP table [table_name], delete a specific tableQuestion 9Select one:a.4,3,1b.1,2,3,4c.2,3,4d.1,2,3
Which SQL statement is used to delete all records from a table?OptionsDELETE ALLREMOVEDROPTRUNCATE
Which SQL command is used to remove a database?OptionsDROP DATABASEREMOVE DATABASEERASE DATABASEDELETE DATABASE
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.