- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is MySQL TRUNCATE command used for?
As the name explains, it is used to remove all the record from the MySQL table.
Truncate table table_name;
mysql> Truncate table student; Query OK, 0 rows affected (0.18 sec)
The query above deleted all the records from the ‘Student’ table. We can observe as MySQL returns empty set after running the following query −
mysql> select * from student; Empty set (0.00 sec)
- What is MySQL DROP command used for?
- What is MySQL DELETE command used for?
- What is the difference between MySQL TRUNCATE and DELETE command?
- What is the significant difference between MySQL TRUNCATE and DROP command?
- What is the use of MySQL TRUNCATE() function?
- What is the significant difference between MySQL TRUNCATE() and ROUND() function?
- MySQL command line client for Windows?
- Truncate with condition in MySQL?
- MySQL truncate text with ellipsis?
- MySQL command for display current configuration variables?
- MySQL command for displaying current configuration variables?
- What is the command used to register gecko driver in Selenium?
- Command Options for Connecting to the MySQL Server
- MySQL BIT_LENGTH() function is used for which purpose?
- For timestamp, which datatype is used in MySQL?