Relational Data Modeling - Foreign Key Constraint (one-to-many relationship) in SQLlite
PRAGMA foreign_key_check find errors