Excuse the non-descriptive title; I couldn't think of a way to sum up the question into a few words.
Suppose I have a relational database schema (as in, I have a database thought out into tables for the entities and relationships that can easily be implemented in SQL)
Let's say I have a numeric attribute in Entity Type A. I want to enforce a rule along the lines of "Every time an entity X of Entity Type A is added to relationship A (with another entity), one of the attributes of that entity X increments by 1."
Would/can this be done in SQL, or would this have to be implemented in whatever application software is accessing the database?
Thanks
Suppose I have a relational database schema (as in, I have a database thought out into tables for the entities and relationships that can easily be implemented in SQL)
Let's say I have a numeric attribute in Entity Type A. I want to enforce a rule along the lines of "Every time an entity X of Entity Type A is added to relationship A (with another entity), one of the attributes of that entity X increments by 1."
Would/can this be done in SQL, or would this have to be implemented in whatever application software is accessing the database?
Thanks