> For the complete documentation index, see [llms.txt](https://docs.reorc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reorc.com/cn-reorc-help-center/shu-ju-jian-mo/zi-dong-hua-ce-shi/singular-tests.md).

# Singular tests

Singular tests are simple SQL queries that return failing records of a model or a resource. They are typically used for one-off checks or specific business rules that do not require reusability.

You can use Jinja functions like `ref()` and `source()` to make reference to the target resource.

For example:

```sql
-- In the payment model, check for payment with negative amount

select *
from {{ ref('payment') }}
where amount < 0
```

## Create a singular test

To add a singular test to a model, open the **Test case template** and select the **Custom SQL** template:

<figure><img src="/files/pRvVkbgOdWSwOQ0g8GzB" alt="" width="563"><figcaption></figcaption></figure>
