1

I have a lot of soccer betting odds (hundreds per match and thousands of matches), for example:

<_10Bet_Home_Home>8.00</_10Bet_Home_Home>
<_10Bet_Home_Away>1.39</_10Bet_Home_Away>
<_10Bet_Home_Draw>4.50</_10Bet_Home_Draw>
<Bet_At_Home_Home>7.50</Bet_At_Home_Home>
<Bet_At_Home_Away>1.40</Bet_At_Home_Away>
<Bet_At_Home_Draw>4.30</Bet_At_Home_Draw>
<Bet365_Home>7.50</Bet365_Home>
<Bet365_Away>1.40</Bet365_Away>
<Bet365_Draw>4.50</Bet365_Draw>
<Bwin_Home>7.00</Bwin_Home>
<Bwin_Away>1.45</Bwin_Away>
<Bwin_Draw>4.25</Bwin_Draw>
<MyBet_Home>7.50</MyBet_Home>
<MyBet_Away>1.43</MyBet_Away>
<MyBet_Draw>4.50</MyBet_Draw>
<NordicBet_Home>7.85</NordicBet_Home>
<NordicBet_Away>1.40</NordicBet_Away>
<NordicBet_Draw>4.50</NordicBet_Draw>
....

What is the best datatype to store them? I need to occupy less storage as possible but also be efficient with sums, means etc.

They don't have a theoretical max value but I don't think they'll go above 100... Decimal(4,2) unsigned?

I know the question may be silly but I'm looking for a confirm from database experts...

1 Answer 1

2

I would use Decimal(4,2) if you are confident that 99.99 is the max value. Decimal(4,2) will consume 2 bytes while decimal(5,2) will consume 3 bytes but give you a safety net if the value were to exceed 99.99; it's up to you how confident your data set will stay under 100.

Not the answer you're looking for? Browse other questions tagged or ask your own question.