Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This example will create three tables:
- -- * people - persons names with associated autoincremeted id number
- -- * groups - groups name with associated autoincremeted id number
- -- * groupmembership - holds list of a person and the group of which they are a member
- --This illustrates the ability to do private/foreign key enforcement within SQLite
- PRAGMA foreign_keys = ON;
- CREATE TABLE people(name text, id integer primary key autoincrement);
- CREATE TABLE groups(name text, id integer primary key autoincrement);
- CREATE TABLE groupmembership(personid integer, groupid integer, foreign key(personid) references people(id), foreign key(groupid) references groups(id));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement