I am trying to define some MySQL relations. I have 3 tables as given below:
employee:
| id | first_name | last_name | email
notifications: (notification names are email, post etc)
| id | name | description
employee_notifications:
| id | employee_id | notification_id |
Is there any advantage (or disadvantage) in changing the employee_notifications table to insert all notification ids of an employee in one row using json_encode?
As of now, there are like 100 employees and 6 notification methods.
There are significant disadvantages. With your current setup, you can easily find out which notifications an employee has, or which employees subscribe to a particular notification. Putting it as JSON in the employees table is going to remove your ability to do that.