> For the complete documentation index, see [llms.txt](https://docs.coffbox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coffbox.com/usage-examples/multi-table-data-stats.md).

# Multi-table Data Stats

Perform data analysis by linking multiple tables together.

## Sample Data

![](https://546336154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvWR9jmxX1LV6WplIPRhL%2Fuploads%2Fgit-blob-5681487c0ccc281af938828408ceaae564cdfaff%2Fcase01_01.png?alt=media) ![](https://546336154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvWR9jmxX1LV6WplIPRhL%2Fuploads%2Fgit-blob-a03e9bdf27c505a46ac701b3804211e10fde55f9%2Fcase03_03.png?alt=media)

## Prompt

> Match the Order IDs in the Returns table with the ones in the Orders table, count how many returns each customer made, and list their ID and name.

## Excel Cursor Response

![](https://546336154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvWR9jmxX1LV6WplIPRhL%2Fuploads%2Fgit-blob-90b93676bd1ccae626b1828f1489e715a5d0f85a%2Fcase03_01.png?alt=media)

## Result

![](https://546336154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvWR9jmxX1LV6WplIPRhL%2Fuploads%2Fgit-blob-38323a179179f27a7a155d32459cbf4e60a4c3b6%2Fcase03_02.png?alt=media)
