"He was my student."
Translation:Er war mein Student.
I found the solution, He and the student are both pointing to the same 'item' (which is the subject) in this sentence, therefore they should both be in first case. HeavenlyYaksha, about your example, there are indeed certain prepositions that need a certain case. However, in this situation, none of them are used.