I am planning to make a very simple betting site. There will be only home, away and draw option for everyweek games. I could not figure it out the database structure. any suggestion? thanks
wtb putting id, teamid, home, away, draw fields and user enum for home away and draw with values '0', '1' and when its 0 = false and when its 1 means thats true so for ex. id teamid home away draw 1 445 0 x 0 means that away was checked goodluck
Everything is simple when you don't have to worry about the details. Work backwards and then worry about the structure. First,--what do you want to know? Make a list. If you have the web page already laid out and now what the results will look like, use that. As for the actual data you will need, obviously who played who, what team was home, which was away and who won. But also, do you want the date of each game played? Score? What data do you want to keep with each team? At least the name, but is there anything else like league, division, coach name, location? Also, will you be keeping track of multiple sports? Football and baseball and roller-derby? If so, that just added a new level of complexity. Take that list and turn it into a spreadsheet. Across the top make all the pieces of data headers, then underneath that construct a fake set of data. Just a couple of rows to make sure that the data you will be collecting has everything you need. Lastly, take the spreadsheet and turn it into a database system. Look up normalization or post back any questions you have once you decide what data you want to collect.
Does this look ok. Teams id team id team name Games id game id week id start time home team away team Users id user id user name pass Bet id bet id user id week id game id home away draw Results id result id week id game id home away draw Correct id correct id week no user id total Thanks