[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

[Solved] sql get query to get any student records who have passed multiple certificates? [closed]

SELECT * FROM student_certificates GROUP BY student_id HAVING COUNT([DISTINCT] certificate_id) >= 20 Join students table if some columns from it needed (do not forget to expand GROUP BY expression accordingly). 1 solved sql get query to get any student records who have passed multiple certificates? [closed]