Explain drop and delete commands with syntax. State the difference between them.

Drop  command: 
When we need to delete a database object from a database the SQL DROP statement is use to remove such database object with its structure. This command also removes all data indexes, triggers constraints and permissions and specifications for those object.
Syntax:
Drop dabase_object <object name>;
Example:
Drop table emp;
Drop sequence sq1; 

Delete Command:
Delete command is used to delete the rows in the table. DELETE removes one or more records from given table.
Syntax:
DELETE from<table_name> [where <conditions>];
Delete From student where roll_no = 1234;

Post a Comment

0 Comments