cqlsh is a command-line shell for connecting to a ScyllaDB cluster and running Cassandra Query Language (CQL) statements. ScyllaDB reuses Cassandra’s cqlsh because it speaks the same protocol. The prompt shows the connected node and component versions, then accepts CQL commands. section 2.2.2
$ docker exec -it scylla-1 cqlsh
Open the shell from the running ScyllaDB Docker container, then issue CQL statements at the cqlsh prompt. section 2.2.2
Use the shell to build a database from the outside in: create a keyspace, create tables inside it, and add data. CQL deliberately resembles simpler SQL forms, but data modeling differs because ScyllaDB has no JOINs; related data may instead be stored together through denormalization. section 2.2.2
Save restaurant reviews
A food-review table accepts INSERT statements in cqlsh. Each write names the target columns and values, including escaped single quotes in strings. Reviews from the same restaurant can remain distinct when their primary-key values, such as ordered time and food, differ. section 2.3.1 section 2.5
cqlsh supports common cluster data tasks:
- Create keyspaces and tables with CREATE KEYSPACE and CREATE TABLE. section 2.2.2
- Read and write data with familiar CQL operations such as SELECT and INSERT. section 2.5
- Change or remove data with UPDATE upserts and DELETE statements. section 2.5
