2 Replies - 1067 Views - Last Post: 07 August 2013 - 08:31 AM Rate Topic: -----

#1 crypotex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-August 13

Problem with tournament tables in SQL Anywhere

Posted 07 August 2013 - 04:13 AM

English is not my first language so i apologize for my errors.
I am new to this forum so hello :)/>/>

I have this E-R diagram shown here.
Posted Image

I have to do a webpage for pool tournaments , single games , leagues and i must be able to show all kinds of statistics.
There is League and tournament separately because a league can consist of tournaments.

This is my first job and i would like to do well , that's why i am asking for your help here.

How should i modify my database for tournaments , like single elimination, double elimination, round robin or round-robin + single elimination.

I was thinking that i will make a procedure for tournaments/leagues that makes a view and adds all people there who play on that tournament and then the procedure looks who is playing with who and those who win get to next game or something ?
Maybe someone has done something similar and gives me a few pointers ?

I hope you can understand what i say in this post, but if you cannot , you can ask me.

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with tournament tables in SQL Anywhere

#2 crypotex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-August 13

Re: Problem with tournament tables in SQL Anywhere

Posted 07 August 2013 - 05:30 AM

Okay let me rephrase the question ... Im sorry , i canät find edit button,

For example lets say i get 32 players and i must pair them with eachother , that is not very hard. But what happens when 16 people win the game and go to next round ? How to i show this in tournament table ? Keep in mind that this must be done instantly and automatically , because i have to show it on screen while tournament is ongoing.

Okay if that is easy , then how should i show for example 32 players doing double elimination , even if you lose you get a second game and the mechanics is complicated ...?

Also what if the playerpool changes , what if there is 17 players ?

This is so hard for me to figure out on my own with only 4 months of experience in programming , PM me or answer here :). I really need help.

Also if u see any mistakes im my tables or something is missing , you can tell me .
Was This Post Helpful? 0
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5937
  • View blog
  • Posts: 12,863
  • Joined: 16-October 07

Re: Problem with tournament tables in SQL Anywhere

Posted 07 August 2013 - 08:31 AM

The Games (I'd prefer Game) table should your main focus.

I see a lot of First_*, Second_* fields in there; this screams for another table.

Sologame can be infered if both Tournamentgame or Leaguegame are null.

WinnerId should only exist in Game. I'm not sure that Start and end times make sense in Tournament. They probably make no sense in League.

Usercomments: which user? Perhaps another table.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1