SQLite 外键 级联更新 删除

前端之家收集整理的这篇文章主要介绍了SQLite 外键 级联更新 删除前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

自身关联

CREATE TABLE Business (ID varchar(50) NOT NULL PRIMARY KEY,Name varchar(200) NOT NULL,"Parent_ID" varchar(50),ConfigurationPage boolean NOT NULL,
FOREIGN KEY(Parent_ID) REFERENCES Business(ID) on delete cascade
)

删除

PRAGMA foreign_keys=ON;delete from business where [ID]=1

猜你在找的Sqlite相关文章