schema

📑 instance

  • given a database schema C=(G,)\mathcal{C} = (G, \simeq), an instance on C\mathcal{C} is a bunch of tables whose data conform to the specified layout
    • G=(V,A,src,tgt)G = (V, A, src, tgt)
  • denote (PK,FK):CSet(\text{PK}, \text{FK}): \mathcal{C} \to \mathbf{Set}
    • consituents:
      • A: primary ID part
        • a function PK:VSet\text{PK}: V \to \mathbf{Set}, sending each vertex vVv \in V to a set PK(v)\text{PK}(v)
      • B: foreign ID part
        • for every arrow aAa \in A where v=src(a)Vv = src(a) \in V and w=tgt(a)Vw = tgt(a) \in V, a function FK(a):PK(v)PK(w)\text{FK}(a): \text{PK(v)} \to \text{PK(w)}
        • each foreign key relation is a function that maps primary key values in one table to the primary key in another table
    • laws: preservation of congruence
      • the congruence (declared on the paths on graph) is preserved