Let’s say I want to make a database that relates emotions with activities. Would it make sense to make a new table every time i encounter a new emotion and inside that table would by say the ids of all the activities that relate to that emotion each id being its own record, or is there a better way of doing it?
Thanks everyone!
I would think you would want a table named Emotions which would contain the universe of emotions. Then you would want a table named Activities which contains the universe of activities.
You then need to determine if each emotion could have multiple activities, and if each activity could have multiple emotions. If so, this is what’s called a many to many association, and you would want a third table that contains each emotion that is associated with each activity. This third table is often called a many to many association table, or mapping table.