r/DatabaseHelp • u/TimOfTroy • Oct 09 '22
Newbie help with D&D Character Database Design
This is the beginning of a database I am trying to design for D&D characters, that I would like to use for an app. I am new to designing databases. I am wondering If I am defining my relationships correctly. How I want it to read is a player can have multiple characters, a character has certain attributes, for class and race you can choose one from the list of available choices. Here is a link to the DrawSQL design https://drawsql.app/teams/timithys-team/diagrams/d-d
3
Upvotes
2
u/NotSoInfamousE Oct 09 '22 edited Oct 09 '22
Based on my assumptions and what you've written above your Characters and Character table should be merged into one. After that, your table structure so far supports what you're after.
Your Races and Classes tables should have attributes of that object (name, description, origin, etc.), not a list of options.
Edit: Glanced back at your ERD and realized I missed that your relationships between Race & Class to Character are incorrect. As modeled they represent and 1:1 relationship, but should instead represent a 1:N relationship
Ex: a Race can belong to Many Characters but a Character can only have One Race
2
u/computer-machine Oct 09 '22
From what I remember of D&D, you're going to want to rearrange the character tables.
Everything static or simple addition goes to the smaller, so XP and probably Race and likely Background.
The other would be a progression, so Level could be an autoincremented field partition/grouped by Character, Class along with Class Level should probably be primary keys along with character ID, and that would be a good place for HP per level.
The Class table would need many more columns, including BAB, saves, maybe a delimited list of feats, and so on.
You may need a separate table for feats selected, since a bunch of classes have choices to make (and races, if you used Advanced rules), in order to track.
Similar with Race table.