Skip to content

Notes chapter 3

Piotr Paradziński edited this page Apr 28, 2020 · 1 revision

category theory for database theory

category theory database theory
category database schema
functor C -> Set database (instance)
functor C1 -> C2 mapping between database schema C1 and C2
adjoint functors data migration

database schema as category:

  • morphisms are columns:
    • FK (morphisms between tables)
    • regular column is morphisms from table to String, Int, ...
    • PK identity morphisms
  • objects: tables
  • hom set: ???

Def A category C consists of:

  • class (can be sth larger than set) of objects Ob(C)
  • for every two objects a,b set of morphisms from c to d
  • identities TODO
  • composition rule TODO such that TODO

Remarks:

  • Change of FK everywhere in DB (don't change data), change of non FK column (modification of data); DBMS theory reverse: never change FK, change other columns as you wish (sic !)
  • objects = (elements, structure, properties), morphisms (sends elements -> elements and preserve structure); properties dissapear in posets - properties: (reflexivity, transitivity); structure - order
    in Cat - identities and associativity dissapears