I want to create some clans in my game... And they can have some admins with some privileges...
Am I need to create 2 tables one of them for clan info and one of them for clan members ?
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
I would create a table for
Clans that would include all of the relevant information for that clan. I would also create a many to many table between the
Users tables. Add foreign key references to both tables to limit data issues. You will need to see if your database supports cascading deletes (I think MySQL does). That will allow your admin/clan leader to delete a clan, automatically removing all of the clan members.
If you later decide to allow your users to be a member of multiple clans, you have already built the framework to support it.
Alternatively, you can extend your existing
User table to include the clan membership for the user. This will work if you only ever want the user to be a member of 1 clan. It will make removing the clan members a little more difficult than using the cascading deletes.