> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/numeric/mod",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for MOD function

# MOD

export const QueryWindow = ({content}) => {
  const {sql, result} = content;
  const [inited, setInited] = useState(false);
  const buttonRef = useRef(null);
  useEffect(() => {
    if (!inited && buttonRef.current) {
      runQuery(buttonRef.current, true);
      setInited(true);
    }
  }, []);
  return <div className="query-window">
      <div className="query-toolbar">
        <button className="run-button" onClick={ev => runQuery(ev.target)} ref={buttonRef}>Run Query</button>
        <span className="window-title">Interactive SQL Playground 🔥</span>
      </div>
      <div className="query-content">
        <pre><code className="firebolt-sql language-sql" contentEditable="true" spellCheck="false" data-original-query={sql}>{sql}</code></pre>
        <script type="application/json" className="fallback-result" style={{
    display: "none"
  }}>{JSON.stringify(result)}</script>
        <div className="server-unavailable-banner query-window-hidden">
          The Firebolt playground server is currently unavailable. Using precomputed query results.
        </div>
        <div className="query-results"></div>
      </div>
    </div>;
};

Calculates the remainder after dividing two values, `<value_n>` / `<value_d>.`

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
MOD(<value_n>,<value_d>)
```

## Parameters

| Parameter   | Description                              | Supported input types      |
| :---------- | :--------------------------------------- | :------------------------- |
| `<value_n>` | The numerator of the division equation   | `INT`, `BIGINT`, `NUMERIC` |
| `<value_d>` | The denominator of the division equation | `INT`, `BIGINT`, `NUMERIC` |

## Return Type

Same as the input.

## Example

The following example returns the remainder of 45 divided by 7:

<QueryWindow
  content={{
"sql": "SELECT MOD(45, 7);",
"result": {
"data": [
  [
    3
  ]
],
"meta": [
  {
    "name": "?column?",
    "type": "int"
  }
],
"query": {
  "query_id": "ae99f6d1-29ba-4471-83a5-fbf160f57d0d",
  "query_label": null,
  "request_id": "fb81ba60-6903-4a25-9624-d0c824d15a31"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.014112,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000256563,
  "time_to_execute": 9.2559e-05
}
}
}}
/>
