Hello,
I'm having trouble with an SQL script file I'm using in my C# application.
I'm trying to use the script file to create the database if the database
does not exist when the program starts. As far as I can tell, there are no
errors in the script file.
----begin pasted SQL script file
CREATE TABLE Artist (
Artist_ID INTEGER PRIMARY KEY,
Artist_Name TEXT NOT NULL
);
CREATE TABLE Genre (
Genre_ID INTEGER PRIMARY KEY,
Genre_Name TEXT NOT NULL
);
CREATE TABLE Label (
Label_ID INTEGER PRIMARY KEY,
Label_Name TEXT NOT NULL
);
CREATE TABLE Medium (
Medium_ID INTEGER PRIMARY KEY,
Medium_Name TEXT NOT NULL
);
CREATE TABLE Album (
Album_ID INTEGER PRIMARY KEY,
Album_Title TEXT NOT NULL,
Album_Year NUMERIC,
Artist_ID INTEGER NOT NULL REFERENCES Artist(Artist_ID),
Genre_ID INTEGER NOT NULL REFERENCES Genre(Genre_ID,
Medium_ID INTEGER NOT NULL REFERENCES Medium(Medium_ID),
Album_Cover BLOB
);
CREATE TABLE AlbumLabel (
Album_ID INTEGER NOT NULL REFERENCES Album(Album_ID),
Label_ID INTEGER NOT NULL REFERENCES Label(Label_ID),
PRIMARY KEY (Album_ID, Label_ID)
);
CREATE TABLE Track (
Track_ID INTEGER PRIMARY KEY,
Track_Number NUMERIC NOT NULL,
Track_Title TEXT NOT NULL,
Track_Length TEXT,
Album_ID INTEGER NOT NULL REFERENCES Album(Album_ID)
);
-----end pasted SQL script file
--
David A. Frischknecht
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users