Don V Nielsen wrote > Just asking some leading questions. You have students. And students have > work pieces. You are then creating a list "uniqueworkpiece" showing the > work pieces associated to each student. Your primary key will ensure the > uniqueness of the student to work piece. > > Do you also need to ensure that the work piece can have one and only one > student? Do you need a unique constraint on both student>work piece and > work piece>student?
Yes, I have students. Every student belong to one grade and to one class, say 5a where 5 is the grade ans 'a' is the class. In the table 'workpiecelist' are workpieces listed, say in grade 5 there are 13 different workpieces out there, in grade 6 there are 14 different workpieces, in grade 7 there are 7, and in grade 8 there are 14 workpieces listed. So, one student in ( or at? ) grade 5 during a school year must to make all those 13 workpieces, but in the grade 5 class 'a' there are 19 students, and every one of them must to make 13 workpieces. So I must have the 'uniqueworkpiece' table to associate every student to every workpiece what that student must to make. So, the 'uniqueworkpiece' table will have few hundred records. So it would be for me easier to fill out the 'uniqueworkpiece' table if I have to enter manually only 'mark' and 'cause' fields, when I am being examine a unique wprokpiece of a student. So that is why I am searching for a solution where a piece of code would fill out for me the 'id' and 'student' fields in the 'uniqueworkpiece' table. ----- 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