python-3.xdatabasesqlitediscord.py

How to store values for each user for each server


This is going to be more of an abstract question, since there's no code I can provide related to this question. I'm a bit new to working with databases, so I'm not familiar with conventional designs (yet).

I have these tables: users and servers.

I currently have a method of keeping score for each user by incrementing the score field in the users table. However, this results in global scores, which is fine, but I would like to be able to track server-specific scores as well.

What would be the best approach for keeping a user's score for each server they use?


Solution

  • To track server specific scores you can just add a table with servers ids by using guild.id.