I have the following Entity Relation diagram (MySQL), which I made for a small project(for the university). I would like to know if the relation between PK and FK is properly made.
I am aware that token should not be used in the users table.
Don't know why my brain cannot comprehend the relationships properly. As far as I've managed to come up is:
Many users can have one role. (User, Admin, University)
One role can be belong to many users.
One user can have one event.
One event can belong to one user.
One user can have many attendings.
Many attendings can belong to one user.
Many events can have many attendings. (Although One event can have many attendings?)
Many attendings can belong to many events. (Although many attendings can belong to one event)
I did another diagram using Reverse Engineering from Workbench, and it gave me almost the same. The only difference is that between events and attenders is a one-to-many relationship.
Sometimes I look at them and I am not aware of which question is the best when 2 questions are possible. Is it one too many, or many too many.... This is a tricky question for my brain. It is like there is a missing link that I cannot grasp, and I am pretty sure it is not that hard.
And this is just a simple relationship, don't wanna know the smack my brain would give me if I were to make a 10-20 tables diagram ... Any other criticism is welcomed :) Thank you!