create table history ( id INTEGER primary key autoincrement, set_id INTEGER not null references card_set on delete cascade, stat_id INTEGER not null references card_stats on delete cascade, timestamp INTEGER not null, answer INTEGER not null, before INTEGER not null, after INTEGER not null );