CREATE TABLE states ( id INT NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL ); CREATE TABLE experiments ( id INT NOT NULL PRIMARY KEY AUTOINCREMENT, description TEXT NOT NULL, state INT REFERENCES states(id) ON UPDATE CASCADE ON DELETE SET NULL )