CREATETABLEusers ( user_id int, fname text, lname text, PRIMARY KEY((user_id))); insert into users(user_id, fname, lname) values (1, 'rick', 'sanchez'); insert into users(user_id, fname, lname) values (4, 'rust', 'cohle'); select*from users;CONSISTENCY QUORUM | ALL
More Queries
SELECT*from heartrate_v1 WHERE pet_chip_id = 123e4567-e89b-12d3-a456-426655440b23;DELETEFROM heartrate_v1 WHERE pet_chip_id = 123e4567-e89b-12d3-a456-426655440b23;
All inserts in Scylla DB (and Cassandra) are actually upserts (insert/update). There can be only one set of values for each unique primary key. If we insert again with the same primary key, the values will be updated.
Data Modelling
Map
CREATETABLEpets_v1 ( pet_chip_id textPRIMARY KEY, pet_name text, favorite_things map<text, text>// A map of text keys, andtextvalues);INSERT INTO pets_v1 (pet_chip_id, pet_name, favorite_things)VALUES ('123e4567-e89b-12d3-a456-426655440b23', 'Rocky', { 'food' : 'Turkey', 'toy' : 'Tennis Ball' });