So here it is:
CREATE TABLE IF NOT EXISTS student (
  id INTEGER CONSTRAINT pk_student PRIMARY KEY AUTOINCREMENT, 
  idnum INTEGER UNIQUE NOT NULL COLLATE NOCASE,
  studentname TEXT NOT NULL COLLATE NOCASE,
  teachinglang TEXT NOT NULL COLLATE NOCASE,
  grade INTEGER,
  classname TEXT NOT NULL,
  formmaster TEXT
);
CREATE TABLE IF NOT EXISTS workpiecelist (
  id INTEGER CONSTRAINT pk_workpiecelist PRIMARY KEY AUTOINCREMENT,
  grade INTEGER,
  quarter INTEGER,
  workpiecenamehu TEXT NOT NULL COLLATE NOCASE,
  workpiecenamesr TEXT NOT NULL COLLATE NOCASE
);
CREATE TABLE IF NOT EXISTS uniqueworkpiece (
  id INTEGER CONSTRAINT pk_uniqueworkpiece PRIMARY KEY AUTOINCREMENT,
  student TEXT NOT NULL REFERENCES student (idnum) ON DELETE CASCADE ON
UPDATE CASCADE ,
  workpiece_list INTEGER NOT NULL REFERENCES workpiecelist (id) ON DELETE
CASCADE ON UPDATE CASCADE,
  mark INTEGER,
  cause TEXT
);



-----
Best, Pál
--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to