Foreign key definition in sqlite
问题 Cant add foreign key constraint in sqlite ........... 回答1: As of SQLite 3.6.19, SQLite supports foreign keys. You need to enable them via: sqlite> PRAGMA foreign_keys = ON; They are turned off by default for backwards compatibility. See the documentation for more details. 回答2: sqlite does not enforce foreign key constraints. 回答3: in sqlite 3 : examples : create table student (_id integer autoincrement primary key ,master_id integer); create table master (_id integer autoincrement primary key