summaryrefslogtreecommitdiff
path: root/manytomany_sqlite.sql
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2014-09-25 21:34:30 -0700
committeryo mama <pepper@scannerjammer.com>2014-09-25 21:34:30 -0700
commite7eaa7ff396723ce93d73f275e7ed156d059b07f (patch)
treea10f0b4befe25670d5958f2c6596035eff8f3f9e /manytomany_sqlite.sql
parentf68564b88dfb3ac08df2d01f883a0276883b96aa (diff)
test
Diffstat (limited to 'manytomany_sqlite.sql')
-rw-r--r--manytomany_sqlite.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/manytomany_sqlite.sql b/manytomany_sqlite.sql
new file mode 100644
index 0000000..2546b5f
--- /dev/null
+++ b/manytomany_sqlite.sql
@@ -0,0 +1,16 @@
+CREATE TABLE cds(
+ id INTEGER PRIMARY KEY NOT NULL,
+ title TEXT NOT NULL
+);
+CREATE TABLE artists(
+ id INTEGER PRIMARY KEY NOT NULL,
+ name TEXT NOT NULL
+);
+CREATE TABLE cds_and_artists(
+ cds_id INTEGER,
+ artists_id INTEGER,
+ FOREIGN KEY(cds_id) REFERENCES cds(id) ON DELETE CASCADE,
+ FOREIGN KEY(artists_id) REFERENCES artists(id) ON DELETE CASCADE
+);
+CREATE INDEX cdsindex ON cds_and_artists(cds_id);
+CREATE INDEX artistsindex ON cds_and_artists(artists_id);