> For the complete documentation index, see [llms.txt](https://docs.insuraviews.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.insuraviews.com/getting-started/additional-tools/query-builder.md).

# Query Builder

Run precise SQL queries directly against the Insuraviews database for highly customized analysis.

**What it does:** Provides direct database access for users who need specific data combinations not available through standard search and reporting tools. This access is through both a traditional SQL Editor, where users can create their own queries, or Natural Language Queries, where users can enter plain language questions, and a query will be generated for you.

**Who should use this:**

* Data analysts and actuaries comfortable with SQL
* Users needing complex data relationships
* Teams requiring specific data formats for internal systems
* Advanced users who want maximum flexibility in data extraction

#### **How to use - SQL Editor:**

1. Access "Query Builder" and the "SQL Editor" tab
2. **Write Your Query**: Use SQL syntax to specify exactly what data you need
   * Access tables for filings, companies, states, rate changes, and more
   * Join multiple data sources for complex analysis
   * Apply custom filters and calculations
3. **Test and Validate**: Preview results before running full query
4. **Execute Query**: Run against live database
5. **Export Results**: Download your results as a CSV file

**Example Query Types:**

* **Complex Rate Analysis**: "Show me all auto rate increases >10% in California and Texas from companies with >$1B premium, including their loss ratios"
* **Temporal Patterns**: "Compare rate filing timing patterns between Q1 and Q4 over the last 3 years"
* **Regulatory Trends**: "Identify states with fastest approval times for homeowners rate increases"
* **Market Positioning**: "Calculate market share changes based on rate competitiveness by territory"

**Database Schema Access:**

* Complete documentation of available tables and fields
* Data dictionary explaining field definitions and relationships

<figure><img src="/files/GYrxaHE1aB58uS9hlDyA" alt=""><figcaption><p>Query Builder - SQL Editor</p></figcaption></figure>

#### **How to Use - Natural Language**&#x20;

1. Access "Query Builder" and the "Natural Language" tab
2. **Write your Question**: No need for SQL syntax or technical knowledge, Natural Language allows for standard questions to be converted into SQL
3. **Generate SQL**: Converts the question to an SQL query, and then runs the query against the live database
   * Generated query is provided to the user for options to copy and edit it in the SQL Edito
4. **Export Results**: Download your results as a CSV file

**Example Questions:**

* "What is the premium-weighted rate impact for Homeowners filings in the last 12 months?"
* "Which DOI reviewers have completed the most filings?"
* "List the most common rating factors used for Personal Auto filings."

<figure><img src="/files/BC1vepijvRj5wyftGWoE" alt=""><figcaption><p>Query Builder - Natural Language</p></figcaption></figure>

#### **Safety Features:**

* Read-only access ensures data integrity
* Query timeout limits prevent system overload
* Result size limits for manageable outputs
* Query history for reproducing previous analysis


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.insuraviews.com/getting-started/additional-tools/query-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
