> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.coactive.ai/latest/docs-guides/core-features/query-engine/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coactive.ai/_mcp/server. ## Getting Started with SQL on the Platform Coactive enhances Visual Analytics with a SQL interface designed to interact with your visual data, enabling users to perform advanced queries on dynamic tags, concepts, and visual metadata. This document explains the SQL interface used to query various tables within the Coactive platform. By the end of this guide, your team will be able to leverage Coactive’s SQL capabilities to perform advanced analytics and unlock deeper insights into your visual data. ### Open the SQL platform 1. Navigate to the Queries section from the platform; 2. Select the `Dataset` you want to query and the embedding will automatically be selected. ![Overview of the Coactive query engine](/_fern-img/5ac910618e02cd0d74dab40c27e58b50441c3ba410957220c0358fac7301be95.webp) ### Display available tables The first step when working with SQL is identifying which tables are available in the platform. ```sql SHOW TABLES; ``` This will list all the tables accessible within your dataset, helping you identify the data resources you can work with. ![Overview of the Coactive query engine](/_fern-img/df5ba960a4db4117c14b500e8b1ff0ff6fa98e18041a0408ad6982ea74be893d.webp) ### Retrieve Column Names from a Table To understand the structure of a specific table, use the **DESCRIBE** statement. ```sql DESCRIBE coactive_table; ``` This query will return all column names and their data types. For example, in coactive\_table, you’ll find columns such as coactive\_image\_id, keyframe\_index, path, concept columns, etc. ### Understand Data Volume To measure the size of your dataset and estimate query performance, you can count the total number of rows in a table. For larger datasets, it’s often helpful to use a Common Table Expression (CTE) to structure your queries: ```sql WITH row_count AS ( SELECT COUNT(*) AS total_rows FROM coactive_table ) SELECT total_rows, CONCAT('This table contains ', total_rows, ' rows.') AS summary FROM row_count; ``` * **WITH row\_count AS**: Creates a temporary table to store the total row count for better readability. * **CONCAT**: Constructs a human-readable summary to provide clarity on the data volume. Expected Output: ![Overview of the Coactive query engine](/_fern-img/23b77685bd1c1c1fef83d92d935051629a63526d74a39ef046501feea113eca1.webp)