Question about databases/SQL

  • Thread starter Thread starter Lucifer666
  • Start date Start date
  • Views Views 711
  • Replies Replies 0

Lucifer666

all the world needs is me
Member
Joined
Apr 22, 2011
Messages
1,626
Reaction score
1,011
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