Bank Modeling

Asked

Viewed 168 times

-2

I am trying to model a bench for a simple Pool for the World Cup games. It would be that way even?

DER

The idea is that the person can register and make guesses for each match informing a winner or whether they will have a draw.

  • Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).

1 answer

1

Without knowing what you need to do in detail, you can’t tell if it’s right or good. I can speculate on what is the least obvious about the area addressed.

I don’t know what the table Partida_has_Selecao Do, I think she’s over there.

The table Partida should have the id of the two selections and not the names. And the result should be divided into two columns with the score of each team. Unless you just need to know who the winner was or was tied, which a simple numerical value or three-state enumeration would suffice. I can’t imagine why you need to be one VARCHAR(45).

On the table Aposta I’d put a Id as a primary key, but it’s my taste within my experience. I don’t understand what the third column is for. And the pattern of the hunch should follow the pattern of the result of Partida. In the Status a boolean would be enough.

It can be more sophisticated, but it depends on what the application wants to do.

  • Maniero, thank you for your help. You’ve already clarified enough. How can I pass two Ids from the same table to another? About the result, what interests me is only the name of the winner or if it was tied. Could you let a simple varchar(3)? In the Bet table, I agree with you regarding placing an id for each Bet. The Status column would be to know if the bettor came to make the "payout" of the bet (Paid or Pending)

  • So it really needs a lot more than you did on the value of the bets, anyway it seems to me that a boolean type is enough. The winner can be a simple numeric, since there are only 3 possibilities. VARCHAR is for descriptions, not the case. I did not understand about the IDs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.