> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onchainsuite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Query Editor

> Use SQL in Onchain Suite to explore user, wallet, and contract activity data for audience building.

## What It Does

The SQL query editor is for operators and analysts who need more precision than simple rule builders. It is especially useful when you want to combine onchain behavior, audience state, and messaging history in one cohort definition.

## Common Questions To Answer

* Which wallets interacted with a contract recently but have not converted?
* Which contacts clicked a campaign and then returned onchain?
* Which users have high-value wallet activity but low recent engagement?
* Which cohort should move into a campaign, report, or automation next?

## What You Can Query

The current intelligence model supports tables for audience and delivery analysis such as contacts, delivery events, audience profiles, audience segments, campaigns, user onchain metrics, wallet activity summary, and NFT holdings.

## Query Workflow

1. Start from a known table or starter query.
2. Limit the date range while iterating.
3. Validate a few rows manually.
4. Save the result as a report or segment.
5. Reuse the output in campaigns or automation handoff.

## Guardrails

Treat SQL outputs as draft audience definitions until reviewed. Safe, readable, narrow queries are easier for the full team to trust and reuse.
