A data test is a query that returns records violating a rule. If it returns no failing records, the test passes. Generic tests reuse that pattern across models and columns.
Unique checks repeated non-NULL values; not_null checks missing values. Use both when a column must behave like a primary key.
Accepted values defines a permitted set, and relationships checks whether a non-NULL child value appears in a parent column. Relationships alone doesn't reject a NULL child key. The distinction matters when you promise downstream users complete references.
Declare the tests in a model properties YAML file, then run build or test. These tasks start with clean staged records where a passing check is possible, but the project must contain the requested test, not just SQL that happens to return tidy rows.