Interview Questions   Tutorials   Discussions   Programs   

DB2 - What is difference between DROP TABLE & DELETE TABLE ?




344
views
asked mar August 25, 2014 11:54 AM  

What is difference between DROP TABLE & DELETE TABLE ?


           

1 Answers



 
answered By Mswami   0  
The DROP statement will delete the object definition of catalog. Ie., DROP command is used for deleting the table and its structure from the data base.

Example:

DROP TABLE EMPLOYEE 

DELETE:

DELETE statement is used to delete the record(s) from a table or a view. You can delete all records in the table or selected record which satisfies the condition.

Example 1:  To delete all records from the table, We need to use following command but the structure of the talbe remains the same.

DELETE * FROM EMPLOYEE

Example 2:  To delete some records which satisfies the given condition.

DELETE FROM EMPLOYEE
WHERE EMP_ID = 10036

After executing above query one record will be deleted from the table.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert