aboutsummaryrefslogtreecommitdiffstats
path: root/docs/constraint-classification.puml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2025-12-01 18:34:31 -0300
committerGitHub <noreply@github.com>2025-12-01 18:34:31 -0300
commit8c8b32d59acc78c7c3e1e8ecae8492a1b728b482 (patch)
treeb218e550b2b09e4920af6e12db531bfd65f65929 /docs/constraint-classification.puml
parente03b7c75be589d12ddc97d074abd2e3a5c6b7cdf (diff)
downloadSakura-8c8b32d59acc78c7c3e1e8ecae8492a1b728b482.tar.gz
Sakura-8c8b32d59acc78c7c3e1e8ecae8492a1b728b482.zip
Diagrams (#18)
Diffstat (limited to '')
-rw-r--r--docs/constraint-classification.puml82
1 files changed, 82 insertions, 0 deletions
diff --git a/docs/constraint-classification.puml b/docs/constraint-classification.puml
new file mode 100644
index 0000000..09094f1
--- /dev/null
+++ b/docs/constraint-classification.puml
@@ -0,0 +1,82 @@
+@startuml constraint-classification
+!theme plain
+title Constraint Classification (McGoveran Framework)
+
+package "Database Constraints" {
+ class RelationConstraints {
+ Which relations must/can exist
+ Example: referential integrity
+ }
+
+ class CardinalityConstraints {
+ Relation size limits
+ Examples:
+ - exactly N tuples
+ - at most M tuples
+ }
+}
+
+package "Relation Constraints" {
+ package "Tuple Constraints" {
+ class AttributeConstraints {
+ Domain constraints per attribute
+ Examples:
+ - age >= 18
+ - salary > 0
+ - name ≠ ""
+ }
+
+ class TupleLevelConstraints {
+ Cross-attribute rules
+ Example:
+ if salary > 200k then age >= 30
+ }
+ }
+
+ package "Relation-Level Constraints" {
+ class KeyConstraints {
+ Uniqueness + not null
+ - Primary keys
+ - Candidate keys
+ - Composite keys
+ }
+
+ class FunctionalDependencies {
+ A → B
+ Example: ZIP → {city, state}
+ }
+
+ class ForeignKeys {
+ Inclusion dependencies
+ Example: employee.dept_id ⊆ department.id
+ }
+ }
+}
+
+package "Transition Constraints" {
+ class StateTransitionRules {
+ Before → After constraints
+ Examples:
+ - salary (monotonic increasing)
+ - created_at (immutable)
+ }
+
+ class TemporalConstraints {
+ Time-based rules
+ Example: end_date >= start_date
+ }
+}
+
+package "Multi-Relation Constraints" {
+ class AggregateConstraints {
+ Cross-relation aggregates
+ Example: sum(dept_salaries) <= dept_budget
+ }
+
+ class MutualExclusion {
+ Disjoint sets
+ Example: managers ∩ ICs = ∅
+ }
+}
+
+@enduml