GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus

 Print  |  
Question:  How many ways you can delete the table records ?

Answer: In how many ways can I delete all the contents of a table and the entire table. Explain with syntax ?


June 06, 2009 00:29:59 #6
 Shivani Goel   Member Since: June 2009    Total Comments: 4 

RE: How many ways you can delete the table records ?
 

Two ways
1. DELETE
2. TRANCATE


BY using delete----
U can delete one nd all rows by using delete command
syntax-
        delete from tablename where column_name=column_value;  
                (it will delete the row related to given column value)
        delete * from tablename;
                 (it will remove all the rows from the table)
NOTE-1- In case of delete stil high water mark remain set to same position even   
               after deleteing all the rows.
          2- Also the rows never release the memory space .
          3- U can rollback in case of delete.



BY using trancate-----
U can delete all the rows by using the trancate command.
syntax-
        trancate table tablename;

NOTE- 1- in case of trancate high water mark get set to zero.
           2- all the rows get deleted nd relase the memory space but structure,
                index nd constraint remain the same.
           3- U can never rollback in case of trancate command.
                       

     

 

Back To Question