Let’s start by making sure our node is still up:
docker exec -it scyllaU nodetool status
Run a CQL shell:
docker exec -it scyllaU cqlsh
Create a keyspace called “mykeyspace”:
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};
Next, create a table with three columns: user id, first name, and last name, and insert some data:
use mykeyspace;
CREATE TABLE users ( user_id int, fname text, lname text, PRIMARY KEY((user_id)));
Insert into the newly created table two rows:
insert into users(user_id, fname, lname) values (1, 'rick', 'sanchez');
insert into users(user_id, fname, lname) values (4, 'rust', 'cohle');
Read the table contents:
select * from users;
To summarize, we saw how easy it is to start a ScyllaDB cluster and perform some basic CQL operations. In the next lessons, we will see some more advanced commands.
Read more about the CQL shell here.