# 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="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2F4s44a4kLJv2Cs9XjtFMt%2Fconstraint-augmented-generation-cag-constraint-example_June%2009%202025.png?alt=media&#x26;token=3c874126-a797-4478-9248-98147241c122" 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](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/predefined-constraints/inequality).

```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**](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag) guide for the API reference, a list of predefined constraints, and instructions for programming your own constraint.
