Is foreign key reference from two different primary key from two different tables valid?
- by arundex
I have a foreign key that has to refer primary keys of two different tables.
Table 1: animal
animal_ id (primary key)
Table 2: bird
bird_ id (primary key)
Table 3: Pet_info
pet_id,
type ENUM ('bird', 'animal')
foreign key (pet_ id) references animal(animal_id), bird(bird_id)
So, I need to check for pet_id…