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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reorc.com/cn-reorc-help-center/shu-ju-jian-mo/zi-dong-hua-ce-shi/singular-tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
