Was this page helpful?
CQL Console BETA¶
The CQL Console lets you run CQL queries against a ScyllaDB Cloud cluster directly from your browser. You don’t need to install cqlsh, drivers, or any other client tools, and you don’t need to add your IP address to the cluster’s allowed IP list.
Use the CQL Console to:
Create keyspaces and tables and insert your first rows.
Check a schema or inspect data.
Run ad-hoc queries.
Prerequisites¶
A ScyllaDB Cloud cluster with public connectivity. The CQL Console is not available for clusters that are reachable only through VPC peering or private connectivity.
The username and password of a database role. The default credentials are shown on your cluster’s Connect tab.
Open the CQL Console¶
Open the cluster you want to query.
Click the CQL Console tab.
Enter your username and password. You can find the default credentials on your cluster’s Connect tab. Your credentials are used only for the current browser session and are never stored.
Click Connect.
When you’re connected, you can type CQL statements at the cql prompt and
press Enter to run them.
To use cqlsh in your terminal instead, click Continue in my terminal below the console.
Example: From a New Cluster to Your First Rows¶
This example creates a keyspace and a table for zoo animals, adds a few rows, and queries them. Run the statements one by one.
List keyspaces:
DESCRIBE KEYSPACES;
Create a keyspace and a table:
CREATE KEYSPACE IF NOT EXISTS zoo;
USE zoo;
CREATE TABLE IF NOT EXISTS animals (
species text,
name text,
habitat text,
age int,
weight_kg double,
PRIMARY KEY (species, name)
);
In this table, species is the partition key, so all animals of the same
species are stored together. name is the clustering key, which identifies
each animal within its species.
Insert data:
INSERT INTO animals (species, name, habitat, age, weight_kg)
VALUES ('lion', 'Leo', 'savanna', 6, 190.5);
INSERT INTO animals (species, name, habitat, age, weight_kg)
VALUES ('lion', 'Zara', 'savanna', 5, 126.0);
INSERT INTO animals (species, name, habitat, age, weight_kg)
VALUES ('penguin', 'Pebble', 'antarctic', 3, 22.3);
Query data:
SELECT * FROM animals WHERE species = 'lion';
SELECT name, habitat, age FROM animals
WHERE species = 'penguin' AND name = 'Pebble';
Show the table definition:
DESCRIBE TABLE zoo.animals;
To remove the example data, drop the keyspace:
DROP KEYSPACE zoo;