I'm currently designing a database design for a thesis repository. I came across this situation:
• A student can submit ONLY ONE thesis, and a thesis can be submitted by MANY students.
However, I do not want to make the Thesis ID repeat for the Thesis table. Should I use a junction table? I have made an initial design (below) with one. Am I in the right track?
I suggest that just put thesisID column on Students Table,
You are almost there. Only I have a comment on the
Thesis_Students
table, I see you have bothThesisID
andStudentID
as PK, which will cover that, one student should be related to a Thesis only once. But you have an additional condition "A student can submit ONLY ONE thesis". So you need an additionalUNIQUE
constraint with onlyStudentID
, so that no more than one entry for anyStudentID
can be inserted. (Well actually, in which case your PK forThesisID
+StudentID
not needed anymore, since you cannot anyhow insert more than one entry for theStudentID
).