Learn MS SQL from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Truncate, Drop And Delete Commands In SQL

Umasankar Natarajan
07/07/2017 0 0


  • Truncate command will delete the Table data only, it keeps the table schema as it is.
  • Table data Can be rollback
  • Example : TRUNCATE TABLE User;


  • Drop command will delete both Table data table schema.
  • Table data Can be rollback
  • Example : DROP TABLE User;


  • Delete command will delete the particular row based on the criteria in Where clause. If where clause is not mention in the squre, it will delete entire data, that is equalent to Truncate command action.
  • Once delete the data, data can not be rollback. Make sure to include where clause in the delete query.
  • Example : DELETE FROM User WHERE userid = 5;

Note: This concept will work only for MS SQL. It may be different or reverse in oracle sql and MySQL

0 Dislike
Follow 0

Please Enter a comment


Other Lessons for You

SQL Join Types
There are four basic types of SQL joins: inner, left, right, and full. The easiest and most intuitive way to explain the difference between these four types is by using a Venn diagram, which shows all...

Write A Query To Get Nth Highest Salary
WITH CTE AS ( SELECT EmpID, EmpName, EmpSalary, RN = ROW_NUMBER() OVER (ORDER BY EmpSalary DESC) FROM dbo.Salary ) SELECT EmpID, EmpName, EmpSalary FROM CTE WHERE RN = @NthRowUse...

What is database backup? How backup works in SQL Server?
Database Backup in normal terms can be said as a copy of data which can be used in a situation when the things go wrong with your system/server. If your role is IT/Database Administrator, then it is your...

Difference Between Stored Procedure And Function
Stored Procedures Functions Stored procedures may or may not return a value Function should return a value Stored procedure should be executed by ‘EXECUTE’...

Looking for MS SQL Classes?

The best tutors for MS SQL Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn MS SQL with the Best Tutors

The best Tutors for MS SQL Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more