O'Reilly logo

Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.3. State Transition Tables

When most newbies think of constraints, they know only static column constraints, such as NOT NULL, DEFAULT, and CHECK () clauses. A little bit later, they will learn about simple declarative referential integrity (DRI) constraints. That means simple PRIMARY KEY and REFERENCES clauses with some simple actions to bring the database to a state consistent with business rules.

The bad news is that there are not enough SQL constructs for all business rules. A transition constraint says that an entity can be updated only in certain ways. These constraints are often modeled as a state transition diagram. There is an initial state, flow lines that show what the next legal state(s) are, and one or more termination states. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required