Hi, to explain my problem, I'll give a simple example:
My database has three tables:
[positions] - position_id INT - position VARCHAR [employees] - employee_id INT - position_id INT - FK - name VARCHAR - birth_date DATE [vehicles] - vehicle_id INT - model VARCHAR - year VARCHAR - color VARCHAR
The problem is that I must associate one vehicle with one employee whose position in the company is "Driver", and only in that case.
I tried to use inheritance and create another table called "Driver" having a ForeignKey associated with one employee (1-1 relationship), but I couldn't make it work because in the programming stage I'll have to manually verify if the selected position id (in the HTML select element) is the id of the "Driver". I believe that is not a good programming practice.
In conclusion, I would like to know if there are other ways to do this without prejudice the relational database or the programming.
Thanks in advance! And sorry for the bad english, it's not my primary language. I hope you can understand.