Syntax
SQL Empty a Table Syntax
In SQL, empty a table: removes all rows quickly — TRUNCATE TABLE logs;
Quick Answer
- Syntax
TRUNCATE TABLE logs;
SQLSyntax
Empty a Table
Code example
TRUNCATE TABLE logs;
Removes all rows quickly.
How to empty a table in SQL
- Open your SQL file or editor.
- Copy the example, then replace its sample names and values for your code.
SQL Empty a Table Syntax
Use TRUNCATE TABLE logs;.
Related Syntax References
Frequently asked questions
What is the SQL syntax for empty a table?
Use this pattern: TRUNCATE TABLE logs;
Can I copy this SQL code example?
Yes. Use Copy code and adapt the example to your program.
Is this SQL syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify