> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-mintlify-cccf65ca.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL templates

> Use our SQL templates to get started with your table calculations!

<Tip>
  Looking for a simpler alternative to raw SQL? Check out the built-in [row functions](/references/table-calculation-functions/row-functions) and [pivot functions](/references/table-calculation-functions/pivot-functions) — they handle common patterns like accessing previous rows and working across pivot columns without needing to write window function SQL.
</Tip>

<CardGroup cols={2}>
  <Card title="Percent change from previous" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/percent-change-from-previous" iconType="solid" horizontal />

  <Card title="Percent of previous value" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/percent-of-previous-value" iconType="solid" horizontal />

  <Card title="Percent of column total" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/percent-of-total-column" iconType="solid" horizontal />

  <Card title="Percent of group/pivot total" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/percent-of-group-pivot-total" iconType="solid" horizontal />

  <Card title="Rank in column" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/rank-in-column" iconType="solid" horizontal />

  <Card title="Running total" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/running-total" iconType="solid" horizontal />

  <Card title="Rolling window" icon="file-lines" href="/guides/table-calculations/table-calculation-sql-templates/rolling-window" iconType="solid" horizontal />
</CardGroup>
