# Constraints

Do you have **business rules** in your dataset? These are deterministic rules that every single row in your data *must* follow in order to be considered valid. By default, SDV synthesizers are *probabilistic* so they may not learn to match your rule 100% of the time.

The good news is that you can input your business rules into your synthesizer using **constraints**. Our constraint-augmented generation ensures that your synthetic data meets the constraint — 100% of the time.

## Constraint Example

One example of a business rule is when the values in one column always have to be greater than values in another column. This is true for every single row of data.

<figure><img src="/files/LdCvhcE1qaSKj8tROt47" alt=""><figcaption><p>In this business rule, the <code>checkout_date</code> must be greater than the <code>checkin_date</code> for all rows.</p></figcaption></figure>

You can supply this business rule to a synthesizer using using an [Inequality constraint](/sdv/concepts/constraint-augmented-generation-cag/predefined-constraints/inequality.md).

```python
from sdv.cag import Inequality

my_constraint = Inequality(
    low_column_name='checkin_date',
    high_column_name='checkout_date'
)

my_synthesizer.add_constraints(constraints=[
    my_constraint
])
```

## Resources

Please refer to our [**Constraint-Augmented Generation**](/sdv/concepts/constraint-augmented-generation-cag.md) guide for the API reference, a list of predefined constraints, and instructions for programming your own constraint.


---

# 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.sdv.dev/sdv/single-table-data/modeling/customizations/constraints.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.
