CQL for Cassandra 2.x

Inserting data into a table

In a production database, inserting columns and column values programmatically is more practical than using cqlsh, but often, being able to test queries using this SQL-like shell is very convenient.

Procedure

To insert employee data for Jane Smith, use the INSERT command.
INSERT INTO emp (empID, deptID, first_name, last_name)
  VALUES (104, 15, 'jane', 'smith');
Show/hide