Inserting data

Let's write some data to that table. To do this, we'll use the INSERT statement. With an INSERT statement, all PRIMARY KEY components must be specified; we will specify status and order_id. Additionally, every column that you wish to provide a value for must be specified in a parenthesis list, followed by the VALUES in their own parenthesis list:

INSERT INTO order_status (status,order_id,total) VALUES ('PENDING',UUID(),114.22);INSERT INTO order_status (status,order_id,total) VALUES ('PENDING',UUID(),33.12);INSERT INTO order_status (status,order_id,total) VALUES ('PENDING',UUID(),86.63);INSERT INTO order_status (status,order_id,total,shipping_weight_kg)  VALUES ('PICKED',UUID(),303.11,2);INSERT INTO order_status (status,order_id,total,shipping_weight_kg) ...

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.