<a id="cql-console"></a>

# 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

1. Open the cluster you want to query.
2. Click the **CQL Console** tab.
   ![The Connect to CQL dialog on the CQL Console tab, with the Username and Password fields](cloud-setup/images/cql-console-credentials.png)
3. 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.
4. Click **Connect**.

When you’re connected, you can type CQL statements at the `cql` prompt and
press **Enter** to run them.

![The CQL Console showing the results of CREATE KEYSPACE, DESCRIBE KEYSPACES, USE, and CREATE TABLE statements](cloud-setup/images/cql-console-example.png)

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:

```cql
DESCRIBE KEYSPACES;
```

Create a keyspace and a table:

```cql
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:

```cql
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:

```cql
SELECT * FROM animals WHERE species = 'lion';

SELECT name, habitat, age FROM animals
WHERE species = 'penguin' AND name = 'Pebble';
```

Show the table definition:

```cql
DESCRIBE TABLE zoo.animals;
```

To remove the example data, drop the keyspace:

```cql
DROP KEYSPACE zoo;
```

## Related Topics

* [Connect to Your Cluster](https://cloud.docs.scylladb.com/stable/cloud-setup/connect-to-cluster.md)
* [CQL reference](https://docs.scylladb.com/manual/stable/cql/)
* [ScyllaDB drivers](https://docs.scylladb.com/stable/drivers/cql-drivers.html)
