CREATE TABLE child_address_t (
  child INTEGER REFERENCES child_t(id), 
  address TEXT
);

CREATE TABLE child_t (
  id INTEGER PRIMARY KEY, 
  name TEXT, 
  delegate TEXT
);

CREATE TABLE whitelist_t (
  child INTEGER REFERENCES child_t(id), 
  address TEXT
);

CREATE VIEW child_v AS 
  SELECT c.id as id, 
         c.delegate as delegate, 
         ca.address as address 
  FROM child_t c, 
       child_address_t ca 
  WHERE c.id = ca.child;

