Q-1-What is difference between drop and delete command? Q-2-what is difference between drop and truncate commands? Q-3-Why truncate is DDL command? Q-4- What is select commands?
Q-1-What is difference between drop and delete command?
Drop command | Delete command |
1-Drop command belong to DDL. 2- Drop commands delete both header and table permanently. 3-Drop commands does not support where conditions. Syntax: Drop table<Table_Name>; | 1-Delete command belongs to DML 2-Delete commands delete the data / body part of the table. 3-Delete support where conditions. Syntax: Delete from<table_name> where <conditions>; |
Q-2- what is difference between drop and truncate commands?
Drop commands | Truncate commands |
1-Drop command belong to DDL. 2- Drop commands delete both header and table permanently. 3-Drop commands does not support where conditions. Syntax: Drop table<Table_Name>;
| 1-Truncate commands belong to DDL. 2-Truncate command will delete both header and body of the table and re-create the header. 3-Truncate does not support where conditions.
Syntax: Truncate table<Table_name>;
|
Q-3-Why truncate is DDL command?
Ans-The Truncate commands is Data Definition Language command that is used to delete the complete data from the table without deleting the table structure.
Q-4-What is select commands?
Ans-Select command is used to fetch the data in a set of records from a table.
Select * from <Table_name>;
Comments
Post a Comment