How can I implement a foreign key in SQLite? I was thinking something like this:
CREATE TABLE job (_id INTEGER PRIMARY KEY AUTOINCREMENT, employer_id INTEGER, ...);
CREATE TABLE employer(_id INTEGER, employer_name TEXT NOT NULL, ...);
Where employer_id
is the _id
from the table employer
. Would this work? Is there another fast, maybe less prone to error way? Maybe with triggers?