How to use a foreign key in sqlite?
问题 I have two tables in sqlite, which are "connected" with an id. The app using this tables is running on Android OS. Table 1;: |id| entry 1| entry2| |1 | aaaaaa | aaaaa | |2 | bbbbbb | bbbbb | Table 2: |id| entryx| constant| |1 | aaaaa | aaaaaaaa| |1 | baaaa | baaaaaaa| |1 | caaaa | caaaaaaa| |2 | ababa | baabaaba| At the moment I delete entries with the following query, by using a loop: do{ db.delete("Table 1","id='"+cid+"'",null); db.delete("Table 2","id='"+cid+"'",null); } while(getNextID())