Database constraints enable developers to enforce business rules and data integrity right at the true source of the data, the tables! They help do things like ensure data uniqueness in a table, prevent incorrect data from being keyed in, prevent null values and enforce relationships between tables to name a few. Typical constraints (Primary key, Unique, Not Null, Check) can be defined on a table and on that table only. The check constraint can enforce some logic on a column such as allowing only specific values, but none of the above constraints can really verify for the existence of conditions, more specifically conditions external to the table for which the constraint is defined. In Oracle database 26 AI, the ASSERTIONS feature goes a little further and can be used to check for conditions across tables unlike traditional constraints. You can think of Assertions like a cross table constraint. The assertion condition must be validated for each row of data inserted into the tables. previously developers have had to use features like triggers to achieve the same or similar effects.
To learn more about assertions in depth, see the video by Toon Koppelaars and Chris Saxon
cheers 🎊
