> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Console

> Learn about SQL Console

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

export const ExperimentalBadge = () => {
  return <div className="experimentalBadge">
            <div className="experimentalIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.25" d="M5.5 2H10.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M9.50015 2V6.19625L13.4283 12.7425C13.4738 12.8183 13.4985 12.9049 13.4996 12.9934C13.5008 13.0818 13.4785 13.169 13.435 13.246C13.3914 13.323 13.3283 13.3871 13.2519 13.4317C13.1755 13.4764 13.0886 13.4999 13.0002 13.5H3.00015C2.91164 13.5 2.8247 13.4766 2.74822 13.432C2.67174 13.3874 2.60847 13.3233 2.56487 13.2463C2.52126 13.1693 2.49889 13.082 2.50004 12.9935C2.50119 12.905 2.52582 12.8184 2.5714 12.7425L6.50015 6.19625V2" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M4.47656 9.56754C5.30344 9.41254 6.47656 9.47942 7.99969 10.25C10.0153 11.2707 11.4216 11.0569 12.2184 10.7282" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            Experimental feature. <u><a href="/docs/beta-and-experimental-features#experimental-features">Learn more.</a></u>
        </div>;
};

SQL console is the fastest and easiest way to explore and query your databases in ClickHouse Cloud. You can use the SQL console to:

* Connect to your ClickHouse Cloud Services
* View, filter, and sort table data
* Execute queries and visualize result data in just a few clicks
* Share queries with team members and collaborate more effectively.

<h2 id="exploring-tables">
  Exploring tables
</h2>

<h3 id="viewing-table-list-and-schema-info">
  Viewing table list and schema info
</h3>

An overview of tables contained in your ClickHouse instance can be found in the left sidebar area. Use the database selector at the top of the left bar to view the tables in a specific database

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/table-list-and-schema.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=6f5aa2a132b70a9e48dfd7314d1f7201" size="lg" border alt="Table list and schema view showing database tables in the left sidebar" width="1415" height="863" data-path="images/cloud/sqlconsole/table-list-and-schema.png" />

Tables in the list can also be expanded to view columns and types

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/view-columns.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=5760eff1976afca28270dfd5e4e2f0bc" size="lg" border alt="View of expanded table showing column names and data types" width="1415" height="863" data-path="images/cloud/sqlconsole/view-columns.png" />

<h3 id="exploring-table-data">
  Exploring table data
</h3>

Click on a table in the list to open it in a new tab. In the Table View, data can be easily viewed, selected, and copied. Note that structure and formatting are preserved when copy-pasting to spreadsheet applications such as Microsoft Excel and Google Sheets. You can flip between pages of table data (paginated in 30-row increments) using the navigation in the footer.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/abc.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=1adc94b7a29a32a518696ff5dd9b67cb" size="lg" border alt="Table view showing data that can be selected and copied" width="1335" height="756" data-path="images/cloud/sqlconsole/abc.png" />

<h3 id="inspecting-cell-data">
  Inspecting cell data
</h3>

The Cell Inspector tool can be used to view large amounts of data contained within a single cell. To open it, right-click on a cell and select 'Inspect Cell'. The contents of the cell inspector can be copied by clicking the copy icon in the top right corner of the inspector contents.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/inspecting-cell-content.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=c44be3d7b402d6192ddd83a3e7b4a9f2" size="lg" border alt="Cell inspector dialog showing the content of a selected cell" width="1415" height="863" data-path="images/cloud/sqlconsole/inspecting-cell-content.png" />

<h2 id="filtering-and-sorting-tables">
  Filtering and sorting tables
</h2>

<h3 id="sorting-a-table">
  Sorting a table
</h3>

To sort a table in the SQL console, open a table and select the 'Sort' button in the toolbar. This button will open a menu that will allow you to configure your sort. You can choose a column by which to sort and configure the ordering of the sort (ascending or descending). Select 'Apply' or press Enter to sort your table

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sort-descending-on-column.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=7ec00fbb8025ae30e156d1f1bcd7bb2b" size="lg" border alt="Sort dialog showing configuration for descending sort on a column" width="1415" height="863" data-path="images/cloud/sqlconsole/sort-descending-on-column.png" />

The SQL console also allows you to add multiple sorts to a table. Click the 'Sort' button again to add another sort. Note: sorts are applied in the order that they appear in the sort pane (top to bottom). To remove a sort, simply click the 'x' button next to the sort.

<h3 id="filtering-a-table">
  Filtering a table
</h3>

To filter a table in the SQL console, open a table and select the 'Filter' button. Just like sorting, this button will open a menu that will allow you to configure your filter. You can choose a column by which to filter and select the necessary criteria. The SQL console intelligently displays filter options that correspond to the type of data contained in the column.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/filter-on-radio-column-equal-gsm.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=bddfc2f4cec636cb16c2ac5bdb566ccb" size="lg" border alt="Filter dialog showing configuration to filter radio column equal to GSM" width="1415" height="863" data-path="images/cloud/sqlconsole/filter-on-radio-column-equal-gsm.png" />

When you're happy with your filter, you can select 'Apply' to filter your data. You can also add additional filters as shown below.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/add-more-filters.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=33d82739ea5d2cdfac337f978d17b750" size="lg" border alt="Dialog showing how to add an additional filter on range greater than 2000" width="1326" height="756" data-path="images/cloud/sqlconsole/add-more-filters.png" />

Similar to the sort functionality, click the 'x' button next to a filter to remove it.

<h3 id="filtering-and-sorting-together">
  Filtering and sorting together
</h3>

The SQL console allows you to filter and sort a table at the same time. To do this, add all desired filters and sorts using the steps described above and click the 'Apply' button.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/filtering-and-sorting-together.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=5c9b6c1f0882791ddcd15b83c8ab3fc1" size="lg" border alt="Interface showing both filtering and sorting applied simultaneously" width="1415" height="863" data-path="images/cloud/sqlconsole/filtering-and-sorting-together.png" />

<h3 id="creating-a-query-from-filters-and-sorts">
  Creating a query from filters and sorts
</h3>

The SQL console can convert your sorts and filters directly into queries with one click. Simply select the 'Create Query' button from the toolbar with the sort and filter parameters of your choosing. After clicking 'Create query', a new query tab will open pre-populated with the SQL command corresponding to the data contained in your table view.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/create-a-query-from-sorts-and-filters.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=de3a48144615df25520504dcd44e52b0" size="lg" border alt="Interface showing the Create Query button that generates SQL from filters and sorts" width="1415" height="863" data-path="images/cloud/sqlconsole/create-a-query-from-sorts-and-filters.png" />

<Note>
  Filters and sorts aren't mandatory when using the 'Create Query' feature.
</Note>

You can learn more about querying in the SQL console by reading the (link) query documentation.

<h2 id="creating-and-running-a-query">
  Creating and running a query
</h2>

<h3 id="creating-a-query">
  Creating a query
</h3>

There are two ways to create a new query in the SQL console.

* Click the '+' button in the tab bar
* Select the 'New Query' button from the left sidebar query list

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/creating-a-query.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=afecd1bf6ad82079563215abd4732881" size="lg" border alt="Interface showing how to create a new query using the + button or New Query button" width="1415" height="863" data-path="images/cloud/sqlconsole/creating-a-query.png" />

<h3 id="running-a-query">
  Running a query
</h3>

To run a query, type your SQL command or commands into the SQL Editor and click the 'Run' button or use the shortcut `cmd / ctrl + enter`. To write and run multiple commands sequentially, make sure to add a semicolon after each command.

Query Execution Options
By default, clicking the run button will run all commands contained in the SQL Editor. The SQL console supports two other query execution options:

* Run selected commands
* Run command at the cursor

To run selected commands, highlight the desired command or sequence of commands and click the 'Run' button (or use the `cmd / ctrl + enter` shortcut). You can also select 'Run selected' from the SQL Editor context menu (opened by right-clicking anywhere within the editor) when a selection is present.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/run-selected-query.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=853f28d6000f9e55db680d5132d18870" size="lg" border alt="Interface showing how to run a selected portion of SQL query" width="1415" height="863" data-path="images/cloud/sqlconsole/run-selected-query.png" />

Running the command at the current cursor position can be achieved in two ways:

* Select 'At Cursor' from the extended run options menu (or use the corresponding `cmd / ctrl + shift + enter` keyboard shortcut

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/run-at-cursor-2.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=9a47cc63afd4ec6aecba2f9a012ddbee" size="lg" border alt="Run at cursor option in the extended run options menu" width="1415" height="863" data-path="images/cloud/sqlconsole/run-at-cursor-2.png" />

* Selecting 'Run at cursor' from the SQL Editor context menu

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/run-at-cursor.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=5a68f1ab887f90afa85c6a928e773d7a" size="lg" border alt="Run at cursor option in the SQL Editor context menu" width="1415" height="863" data-path="images/cloud/sqlconsole/run-at-cursor.png" />

<Note>
  The command present at the cursor position will flash yellow on execution.
</Note>

<h3 id="canceling-a-query">
  Canceling a query
</h3>

While a query is running, the 'Run' button in the Query Editor toolbar will be replaced with a 'Cancel' button. Simply click this button or press `Esc` to cancel the query. Note: Any results that have already been returned will persist after cancellation.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/cancel-a-query.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=1bef54dbdcca2eac9cf20c2334d8a1fa" size="lg" border alt="Cancel button that appears during query execution" width="1415" height="863" data-path="images/cloud/sqlconsole/cancel-a-query.png" />

<h3 id="saving-a-query">
  Saving a query
</h3>

If not previously named, your query should be called 'Untitled Query'. Click on the query name to change it. Renaming a query will cause the query to be saved.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/give-a-query-a-name.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=2f294aae501591226a6e30b8a9a2d55d" size="lg" border alt="Interface showing how to rename a query from Untitled Query" width="1415" height="863" data-path="images/cloud/sqlconsole/give-a-query-a-name.png" />

You can also use the save button or `cmd / ctrl + s` keyboard shortcut to save a query.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/save-the-query.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=adef9d7c394e865a16748387b2cfbf4a" size="lg" border alt="Save button in the query editor toolbar" width="1415" height="863" data-path="images/cloud/sqlconsole/save-the-query.png" />

<h2 id="using-genai-to-manage-queries">
  Using GenAI to manage queries
</h2>

This feature allows you to write queries as natural language questions and have the query console create SQL queries based on the context of the available tables. GenAI can also help you debug your queries.

For more information on GenAI, checkout the [Announcing GenAI powered query suggestions in ClickHouse Cloud blog post](https://clickhouse.com/blog/announcing-genai-powered-query-suggestions-clickhouse-cloud).

<h3 id="table-setup">
  Table setup
</h3>

Let's import the UK Price Paid example dataset and use that to create some GenAI queries.

1. Open a ClickHouse Cloud service.

2. Create a new query by clicking the *+* icon.

3. Paste and run the following code:

   ```sql theme={null}
   CREATE TABLE uk_price_paid
   (
       price UInt32,
       date Date,
       postcode1 LowCardinality(String),
       postcode2 LowCardinality(String),
       type Enum8('terraced' = 1, 'semi-detached' = 2, 'detached' = 3, 'flat' = 4, 'other' = 0),
       is_new UInt8,
       duration Enum8('freehold' = 1, 'leasehold' = 2, 'unknown' = 0),
       addr1 String,
       addr2 String,
       street LowCardinality(String),
       locality LowCardinality(String),
       town LowCardinality(String),
       district LowCardinality(String),
       county LowCardinality(String)
   )
   ENGINE = MergeTree
   ORDER BY (postcode1, postcode2, addr1, addr2);
   ```

   This query should take around 1 second to complete. Once it's done, you should have an empty table called \`uk\_price\_paid.

4. Create a new query and paste the following query:

   ```sql theme={null}
   INSERT INTO uk_price_paid
   WITH
      splitByChar(' ', postcode) AS p
   SELECT
       toUInt32(price_string) AS price,
       parseDateTimeBestEffortUS(time) AS date,
       p[1] AS postcode1,
       p[2] AS postcode2,
       transform(a, ['T', 'S', 'D', 'F', 'O'], ['terraced', 'semi-detached', 'detached', 'flat', 'other']) AS type,
       b = 'Y' AS is_new,
       transform(c, ['F', 'L', 'U'], ['freehold', 'leasehold', 'unknown']) AS duration,
       addr1,
       addr2,
       street,
       locality,
       town,
       district,
       county
   FROM url(
       'http://prod.publicdata.landregistry.gov.uk.s3-website-eu-west-1.amazonaws.com/pp-complete.csv',
       'CSV',
       'uuid_string String,
       price_string String,
       time String,
       postcode String,
       a String,
       b String,
       c String,
       addr1 String,
       addr2 String,
       street String,
       locality String,
       town String,
       district String,
       county String,
       d String,
       e String'
   ) SETTINGS max_http_get_redirects=10;
   ```

This query grabs the dataset from the `gov.uk` website. This file is \~4GB, so this query will take a few minutes to complete. Once ClickHouse has processed the query, you should have the entire dataset within the `uk_price_paid` table.

<h4 id="query-creation">
  Query creation
</h4>

Let's create a query using natural language.

1. Select the **uk\_price\_paid** table, and then click **Create Query**.

2. Click **Generate SQL**. You may be asked to accept that your queries are sent to Chat-GPT. You must select **I agree** to continue.

3. You can now use this prompt to enter a natural language query and have ChatGPT convert it into an SQL query. In this example we're going to enter:

   > Show me the total price and total number of all uk\_price\_paid transactions by year.

4. The console will generate the query we're looking for and display it in a new tab. In our example, GenAI created the following query:

   ```sql theme={null}
   -- Show me the total price and total number of all uk_price_paid transactions by year.
   SELECT year(date), sum(price) as total_price, Count(*) as total_transactions
   FROM uk_price_paid
   GROUP BY year(date)
   ```

5. Once you've verified that the query is correct, click **Run** to execute it.

<h3 id="debugging">
  Debugging
</h3>

Now, let's test the query debugging capabilities of GenAI.

1. Create a new query by clicking the *+* icon and paste the following code:

   ```sql theme={null}
   -- Show me the total price and total number of all uk_price_paid transactions by year.
   SELECT year(date), sum(pricee) as total_price, Count(*) as total_transactions
   FROM uk_price_paid
   GROUP BY year(date)
   ```

2. Click **Run**. The query fails since we're trying to get values from `pricee` instead of `price`.

3. Click **Fix Query**.

4. GenAI will attempt to fix the query. In this case, it changed `pricee` to `price`. It also realised that `toYear` is a better function to use in this scenario.

5. Select **Apply** to add the suggested changes to your query and click **Run**.

Keep in mind that GenAI is an experimental feature. Use caution when running GenAI-generated queries against any dataset.

<h2 id="advanced-querying-features">
  Advanced querying features
</h2>

<h3 id="searching-query-results">
  Searching query results
</h3>

After a query is executed, you can quickly search through the returned result set using the search input in the result pane. This feature assists in previewing the results of an additional `WHERE` clause or simply checking to ensure that specific data is included in the result set. After inputting a value into the search input, the result pane will update and return records containing an entry that matches the inputted value. In this example, we'll look for all instances of `breakfast` in the `hackernews` table for comments that contain `ClickHouse` (case-insensitive):

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/search-hn.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=f172932022fce32b53d14aa533f173d5" size="lg" border alt="Search Hacker News Data" width="1415" height="863" data-path="images/cloud/sqlconsole/search-hn.png" />

Note: Any field matching the inputted value will be returned. For example, the third record in the above screenshot doesn't match 'breakfast' in the `by` field, but the `text` field does:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/match-in-body.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=a5158e7dcce62adcdc6de123e25df1dc" size="lg" border alt="Match in body" width="1415" height="863" data-path="images/cloud/sqlconsole/match-in-body.png" />

<h3 id="adjusting-pagination-settings">
  Adjusting pagination settings
</h3>

By default, the query result pane will display every result record on a single page. For larger result sets, it may be preferable to paginate results for easier viewing. This can be accomplished using the pagination selector in the bottom right corner of the result pane:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/pagination.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=0c74243c3aa6a25905c57aab90a2e283" size="lg" border alt="Pagination options" width="1415" height="863" data-path="images/cloud/sqlconsole/pagination.png" />

Selecting a page size will immediately apply pagination to the result set and navigation options will appear in the middle of the result pane footer

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/pagination-nav.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=b0a1aed94772256ca10f4330110c9cdc" size="lg" border alt="Pagination navigation" width="1415" height="863" data-path="images/cloud/sqlconsole/pagination-nav.png" />

<h3 id="exporting-query-result-data">
  Exporting query result data
</h3>

Query result sets can be easily exported to CSV format directly from the SQL console. To do so, open the `•••` menu on the right side of the result pane toolbar and select 'Download as CSV'.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/download-as-csv.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=63a7cb1a83cde33868381992f15e909e" size="lg" border alt="Download as CSV" width="1415" height="863" data-path="images/cloud/sqlconsole/download-as-csv.png" />

<h2 id="visualizing-query-data">
  Visualizing query data
</h2>

Some data can be more easily interpreted in chart form. You can quickly create visualizations from query result data directly from the SQL console in just a few clicks. As an example, we'll use a query that calculates weekly statistics for NYC taxi trips:

```sql theme={null}
SELECT
   toStartOfWeek(pickup_datetime) AS week,
   sum(total_amount) AS fare_total,
   sum(trip_distance) AS distance_total,
   count(*) AS trip_total
FROM
   nyc_taxi
GROUP BY
   1
ORDER BY
   1 ASC
```

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/tabular-query-results.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=1a4c7a187f43ef1efcb6eb7237dd4fa5" size="lg" border alt="Tabular query results" width="1415" height="863" data-path="images/cloud/sqlconsole/tabular-query-results.png" />

Without visualization, these results are difficult to interpret. Let's turn them into a chart.

<h3 id="creating-charts">
  Creating charts
</h3>

To begin building your visualization, select the 'Chart' option from the query result pane toolbar. A chart configuration pane will appear:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/switch-from-query-to-chart.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=fbbb38f6566ba26fde9a56f13356db4b" size="lg" border alt="Switch from query to chart" width="1415" height="863" data-path="images/cloud/sqlconsole/switch-from-query-to-chart.png" />

We'll start by creating a simple bar chart tracking `trip_total` by `week`. To accomplish this, we'll drag the `week` field to the x-axis and the `trip_total` field to the y-axis:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/trip-total-by-week.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=76a6f077427fd09fed6e8331e56a5626" size="lg" border alt="Trip total by week" width="1415" height="863" data-path="images/cloud/sqlconsole/trip-total-by-week.png" />

Most chart types support multiple fields on numeric axes. To demonstrate, we'll drag the fare\_total field onto the y-axis:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/bar-chart.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=d8f7b2b4f4f9f91ce15b3652a2a7ad16" size="lg" border alt="Bar chart" width="1415" height="863" data-path="images/cloud/sqlconsole/bar-chart.png" />

<h3 id="customizing-charts">
  Customizing charts
</h3>

The SQL console supports ten chart types that can be selected from the chart type selector in the chart configuration pane. For example, we can easily change the previous chart type from Bar to an Area:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/change-from-bar-to-area.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=3e0e1660e3205d001da0ac2f31bd1103" size="lg" border alt="Change from Bar chart to Area" width="1415" height="863" data-path="images/cloud/sqlconsole/change-from-bar-to-area.png" />

Chart titles match the name of the query supplying the data. Updating the name of the query will cause the Chart title to update as well:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/update-query-name.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=25505911ae1ca6470c5cf24708474e96" size="lg" border alt="Update query name" width="1415" height="863" data-path="images/cloud/sqlconsole/update-query-name.png" />

A number of more advanced chart characteristics can also be adjusted in the 'Advanced' section of the chart configuration pane. To begin, we'll adjust the following settings:

* Subtitle
* Axis titles
* Label orientation for the x-axis

Our chart will be updated accordingly:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/update-subtitle-etc.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=615694a48fb15d724f0497de038cb93a" size="lg" border alt="Update subtitle etc." width="1415" height="863" data-path="images/cloud/sqlconsole/update-subtitle-etc.png" />

In some scenarios, it may be necessary to adjust the axis scales for each field independently. This can also be accomplished in the 'Advanced' section of the chart configuration pane by specifying min and max values for an axis range. As an example, the above chart looks good, but in order to demonstrate the correlation between our `trip_total` and `fare_total` fields, the axis ranges need some adjustment:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/pb3p2qvhHWkIWhRw/images/cloud/sqlconsole/adjust-axis-scale.png?fit=max&auto=format&n=pb3p2qvhHWkIWhRw&q=85&s=fd0568806137fd5225399450d7344c3d" size="lg" border alt="Adjust axis scale" width="1415" height="863" data-path="images/cloud/sqlconsole/adjust-axis-scale.png" />

<h2 id="sharing-queries">
  Sharing queries
</h2>

The SQL console enables you to share queries with your team. When a query is shared, all members of the team can see and edit the query. Shared queries are a great way to collaborate with your team.

To share a query, click the 'Share' button in the query toolbar.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sql-console-share.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=24b7358e628f49f0ab1d644e65fd0e1d" size="lg" border alt="Share button in the query toolbar" width="686" height="260" data-path="images/cloud/sqlconsole/sql-console-share.png" />

A dialog will open, allowing you to share the query with all members of a team. If you have multiple teams, you can select which team to share the query with.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sql-console-edit-access.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=66e87037b23aa81c8f6e7467011ba63f" size="lg" border alt="Dialog for editing access to a shared query" width="682" height="254" data-path="images/cloud/sqlconsole/sql-console-edit-access.png" />

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sql-console-add-team.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=38f689f0c338b21f7282a50cd2b63f0e" size="lg" border alt="Interface for adding a team to a shared query" width="697" height="432" data-path="images/cloud/sqlconsole/sql-console-add-team.png" />

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sql-console-edit-member.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=5d451ff116356d125e1caa818a0d599b" size="lg" border alt="Interface for editing member access to a shared query" width="686" height="374" data-path="images/cloud/sqlconsole/sql-console-edit-member.png" />

In some scenarios, it may be necessary to adjust the axis scales for each field independently. This can also be accomplished in the 'Advanced' section of the chart configuration pane by specifying min and max values for an axis range. As an example, the above chart looks good, but in order to demonstrate the correlation between our `trip_total` and `fare_total` fields, the axis ranges need some adjustment:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ddNWBC5mE_w-syUp/images/cloud/sqlconsole/sql-console-access-queries.png?fit=max&auto=format&n=ddNWBC5mE_w-syUp&q=85&s=42ec1d9e841eca632999354e4d82184e" size="lg" border alt="Shared with me section in the query list" width="687" height="482" data-path="images/cloud/sqlconsole/sql-console-access-queries.png" />
