When using foriegn keys, I am not sure if I am suppose to use foriegn keys in two tables where it contains the same field. For example:
Option Table:
OptionId (PK auto) OptionType
1 A-C
2 A-D
3 A-E
Question Table:
QuestionId (PK auto) Question OptionId (FK Option)
1 2+2 2
2 3+3 1
I make the OptionId in the Question Table a foreign key but am I suppose to make the OptionId in the Option Table a foreign key as well referencing to the Question Table?
No.
A foreign key is a constraint: it is intended to insure database integrity. You wouldn’t want someone to be able to delete an Option that a Question is joined to, as that question would no longer be valid. However, it would make perfect sense to delete a Question even though the Option it was joined to still exists — that Option may well apply to other existing or future questions.