> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vetintelcompany.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vetintelcompany.com/_mcp/server.

# Write a report with SQL

> Define a report section using a read-only query against the reporting schema.

1. Open [Reports](https://www.vetintelcompany.com/app/reports) and select **New Report → Write SQL yourself**. Pro opens an **Untitled Report** with a starter table.

2. Select **Edit manually**, enter a title, and select **Apply**.

3. On the starter table, select **Edit table** and enter a read-only `SELECT` query against an available reporting view. For a small preview of animal care providers, start with:

   ```sql
   SELECT animal_care_provider_id, animal_care_provider_name
   FROM report_animal_care_providers_v
   ORDER BY animal_care_provider_name
   LIMIT 5;
   ```

4. Select **Apply**, then **Preview changes**. Check the returned rows and resolve any validation messages.

5. Select **Save** to keep your changes.

If a view is unavailable, check the reporting schema shown in the editor and your workspace's data access. See [view and export report results](/view-report-results) for the next step.