[Solved] How to use two primary keys into one foreign key? [closed]

It’s called Polymorphic relationship (association). And you can’t have a column (added_by in your case) that references two parent tables simultaneously. But what you can do to be able to use foreign key constraints is to have two nullable columns added_by_super_admin and added_by_admin only one of which will hold the value per record. CREATE TABLE … Read more