TRUNCATE

    The statement removes all rows from a specified table.

    Where

    • table_name is an identifier (possibly qualified with a keyspace name).
    • An error is raised if the specified table_name does not exist.
    1. cqlsh:example> CREATE TABLE employees(department_id INT,
    2. PRIMARY KEY(department_id, employee_id));
    1. cqlsh:example> INSERT INTO employees(department_id, employee_id, name) VALUES (1, 1, 'John');
    1. cqlsh:example> INSERT INTO employees(department_id, employee_id, name) VALUES (2, 1, 'Joe');
    1. cqlsh:example> SELECT * FROM employees;

    Remove all rows from the table.

      1. cqlsh:example> SELECT * FROM employees;