Cassandra Tutorial
Cassandra Keyspace
Cassandra Table Index
Cassandra Query (CQL)
Cassandra Collections
Cassandra Interview
Cassandra DELETE Data
DELETE command is used to delete data from Cassandra table. You can delete the complete table or a selected row by using this command.
Syntax:
DELETE FROM WHERE ;
Example:
6.2M
799
OOPs Concepts in Java
Let's take an example to demonstrate how to delete data from Cassandra table. We have a table named "student" with columns (student_id, student_fees student_name), having the following data.
Delete an entire row
To delete the entire row of the student_id "3", use the following command:
DELETE FROM student WHERE student_id=3;
Row having student_id 3 has been deleted. You can verify it by using SELECT command.
Delete a specific column name
Example:
Delete the student_fees where student_id is 4.
DELETE student_fees FROM student WHERE student_id=4;
It is deleted now. You can verify it:
You can see that it is null now.