SQL adaptation guide for SQLite 3.x / Data dictionary |
CREATE TABLE orders ( ... , FOREIGN KEY(ord_customer) REFERENCES customer(cust_num) ) )
SQLite (3.6.19 and +) implements foreign key support, but this feature is not enabled by default. In fact, it is possible to define foreign keys on tables, but when doing database operations, the constraints are not enforced until you enable it explicitely with a PRAGMA command.
EXECUTE IMMEDIATE "PRAGMA foreign_keys = ON"
Future releases of SQLite might change this, so that foreign key constraints enabled by default.