Question about databases/SQL

Lucifer666

all the world needs is me
OP
Member
Joined
Apr 22, 2011
Messages
1,626
Trophies
1
Location
The Fourth Dimension
XP
2,160
Country
United Kingdom
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: I am the cancer!!! lol