Glossary

Glossary: SQL

SQL (Structured Query Language) is a programming language used to query, filter, and analyze structured data stored in databases and data warehouses, including onchain and protocol analytics data.

What is SQL?

SQL (Structured Query Language) is a programming language used to query, filter, and analyze structured data stored in databases and data warehouses, including onchain and DeFi protocol analytics data.

SQL Explained

Think of a data warehouse as a massive library where every book is a wallet and every page is a transaction. You wouldn't read every page to find what you need, you'd ask a specific question: "show me everyone who deposited over $10k last month." SQL is the language you use to ask that question, and the database hands back exactly the rows that match.

For onchain analytics, this matters because raw blockchain data, transactions, contract calls, transfers, is enormous and unstructured on its own. Once that data is indexed into structured tables, the kind platforms like Formo build under the hood, SQL becomes the way teams turn millions of onchain events into a specific answer: daily active wallets, retention by cohort, revenue by pool.

What SQL Means For

Audience

Use Case

Data and analytics teams

Query onchain and offchain tables directly to build custom reports beyond what's available in prebuilt dashboards

Growth and marketing teams

Self-serve cohort, funnel, or attribution analysis by writing queries against wallet and event data instead of waiting on engineering

DeFi protocol and product teams

Answer specific business questions, like which pool drives the most repeat deposits, by querying the underlying data warehouse

Examples

  • A data analyst writes a SQL query joining wallet addresses with UTM parameters to see which campaign drove the most onchain conversions.

  • A growth team queries transaction history to build a 30-day retention cohort that isn't available as a prebuilt chart.

  • A DeFi protocol's data team runs a SQL query to calculate TVL by pool over the last quarter for an investor update.

  • An analyst joins wallet labels with transaction data to filter out sybil and bot activity before reporting active user counts.

FAQs

What is the difference between SQL and a dashboard? A dashboard shows prebuilt metrics through a visual interface. SQL lets you write custom queries against the raw data underneath it, so you aren't limited to what's already built.

Do you need to be an engineer to write SQL? No. Many growth, marketing, and product teams write basic SQL to self-serveself serve answers rather than filing a request with a data team.

Can SQL query onchain data directly? Not raw blockchain data in its native form, but once onchain events are indexed and structured into tables, querying them with SQL works the same way as querying any other dataset.

What is a data warehouse's role in SQL analytics? The data warehouse stores the structured tables, including onchain and offchain data, that SQL queries run against.

Why do onchain analytics platforms expose SQL access? Prebuilt dashboards can't anticipate every question a team will ask. SQL access lets teams go beyond standard metrics and answer DeFi protocol specific questions on their own.