1. 此句是创建表tabA,表tabB,
其中:
tabA:两个字段,id,name
tabB:三个字段,id,name,fkid
fkid:为外键,关联tabA的id,同时表tabB与表tabA级联更新、级联删除
db.execsql("create table if not exists tabA(" //创建表A,主键为ID
+ "id integer primary key,"+ "name varchar(20))");
db.execsql("create table if not exists tabB(" //创建表B,主键为ID
+ "id integer primary key,"
+ "name varchar(20),"
+ "fkid varchar(20),foreign key(fkname) references tabA(id) On Delete CASCADE On Update CASCADE);");
2. 等待创建触发器