> ## 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.

> Reference material for BOOL_AND

# BOOL_AND

Returns true if all non NULL input value are true, otherwise false. If all input values are NULL values, returns NULL.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
BOOL_AND(<expression>) [FILTER ([WHERE] <condition>)]
```

## Parameters

| Parameter | Description | Supported input types |
| :- | :- | :- |
| `<expression>` | The boolean expression used to calculate the result | `BOOLEAN` |
| `<condition>` | An optional boolean expression to filter rows used in aggregation | `BOOL` |

## Return Types

`BOOLEAN`

## Example

The following query shows a sample of tournaments with the lowest prize amounts, demonstrating that even small-prize tournaments still have positive values:

<div className="query-window">
  ```
  SELECT name, totalprizedollars FROM tournaments ORDER BY totalprizedollars LIMIT 5;
  ```

  | name <span>text null</span> | totalprizedollars <span>int null</span> |
  | :- | :- |
  | The French Grand Prix | 237 |
  | The European Grand Prix | 465 |
  | The Desert Dash Rally | 643 |
  | The Turbocharged Championship Series | 704 |
  | The African Grand Prix | 895 |

  <p><span>Rows: 5</span><span>Execution time: 6.00ms</span></p>
</div>

The following example checks whether every tournament in the `tournaments` table has a non-null, positive prize amount:

<div className="query-window">
  ```
  SELECT BOOL_AND(totalprizedollars IS NOT NULL AND totalprizedollars > 0) AS all_have_prizes FROM tournaments;
  ```

  | all\_have\_prizes <span>boolean null</span> |
  | :- |
  | True |

  <p><span>Rows: 1</span><span>Execution time: 8.72ms</span></p>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.