> SQLite does not support VARCHAR(2). All fields declared like that are > TEXT and SQLite pays no attention to the length of the text. Declare them > as TEXT. > > SQLite does not support TINYINT All fields declared like that are > INTEGER. Declare them as INTEGER. > > Your TEXT NOT NULL fields should be declared as TEXT NOT NULL COLLATE > NOCASE. This will simplify your programming later.
Understood. > Why is this field > >> "idnum" TEXT NOT NULL CONSTRAINT "pk_student" PRIMARY KEY, > > declared as TEXT when it has 'num' in the name ? > > Although it will work, do not do this: > >> CONSTRAINT "pk_uniqueworkpiece" PRIMARY KEY ("student", >> "workpiece_list") > > instead allow that table to have > > INTEGER PRIMARY KEY AUTOINCREMENT > > like your workpiecelist table, and declare a UNIQUE index to enforce > uniqueness. This allows you to make changes without having SQLite > complain about duplication in the primary key. I will in the 'student' table allow an 'id' INTEGER PRIMARY KEY AUTOINCREMENT . Every student have an identification number and such a number is 13 digit long. But some idnumber start with leading zero so I think to it is better to have this filed as TEXT to keep those leading zeros at the beginning of the 'idnum'. I do not want to do calculations with 'idnum' values. ----- 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