I have a REST api that will retrieve info from a database with 4 columns: student, course, university and info.
Given a student,course and university, it will retrieve info that is student-related.
If student is null, then given course and university, it will retrieve info that is course-related.
So ideally i want the primary key to be a composite of student,course,university.
But DB2 doesn't seem to let me create a primary key with a column that could be null.
The other option would be to have all three columns student,course,university be non-nullable.
In that case, DB2 lets me create a primary key using these 3 columns, but i would then have to enter a record where student would be null. Not sure if that is good practice.