I've been "wrestling" with this problem for a while and have been looking around for some place to ask some knowledgeable database people and then I ended up here. This has been a project I've been wanting to do for years but never understood databases and other programming enough to pull it off, until now.
Okay, basically, I understand what I need to do to add to MySQL databases, pull data out and display it, update it, delete it, etc, so that's all covered. No, my problem has been trying to figure out the best way to design the tables to store all the data that I'm going to be collecting to create my pro wrestling database. I've thought of MANY different ways of how to set up the tables to keep the data and best be able to search and store the information, but nothing seems perfect so far and even the best tables I've built are a bit "wonky" in how they work.
I'm going to try to explain this as quickly and efficiently as I can, so that everyone knows how I've been organizing it. Now, my ultimate goal is to create a table or likely series of tables to store all the information on let's say a pro wrestling company, like WWE, for example. I want to store all the results of all the matches of all the shows and pay-per-views, along with general stats of all the wrestlers in the company. Then I want to be able to search the full database in a ton of different ways, like how many times a certain wrestler has won a title, or list all the WrestleMania matches of all time, or show all the winners of the Royal Rumble, and TONS of other stuff like that. The problem with making a pro wrestling database is that with all the match types, stipulations, the numbers of wrestlers in each match, the number of ways a match can end, all the championships, and ALL of that is VERY difficult to keep track of and organize in a rational way.
The list of my current tables to show the best I've come up with, which STILL, as I said, is a bit "wonky" is as follows:
Wrestlers = list of wrestler stats, such as height, weight, name, debut date, nickname, and hometown (and I'm hoping eventually to be able to list all the wins, losses, and draws of all wrestlers, so hopefully I can pull that off too)
Titles = list of championships
Shows = list of all wrestling shows where all the matches have taken place
Matches = list of all matches with info such as match date, title ID number which links to the titles table, show ID number which links to the shows table, stipulation, and extra notes about the match
Results = list of every single wrestler in every single match, all listed separately with info such as match ID number which links to the matches table, wrestler ID number which links to the wrestlers table, and then result, such as win, loss, or draw
NOTE: Each and every table has a unique ID number for all rows, such as Match ID, Title ID, Show ID, Wrestler ID, etc
The current set-up works, in a way, but it's "wonky" in that you store the basic match info in the matches table, and then add in wrestlers to each match into the results table and just link them up with the Match ID and Wrestler ID numbers. It works, like I said, as it draws up the wrestler and show names, but it's just very odd to work with. I tried to normalize it sufficiently, but not TOO much, and it's just very difficult to figure out how to manage this whole thing.
My biggest problem is that with some matches being one-on-one, so only two wrestlers, and others having upwards of like ten to thirty wrestlers in one match, some in teams of various numbers, some all against one another in big battles, I'm not sure how to store the info of who was involved in each match, who won, and if a title was on the line whether it changed hands or was successfully defended or not. If it was simple, such as boxing or any other sport with ONLY one guy vs another guy, or one team vs another, it'd be SIMPLE, but this is very, very complicated, so I was just curious if anyone could help me figure out how to organize this info into well-designed tables, cuz as I've said, so far I'm pretty clueless.
Thanks for reading this lengthy post and any help would be greatly appreciated.
