I have a table in the db ,used as lookup to see what score a certain value has. The table
5 1
10 2
15 3
If given an input, example 6, how do I query the table in Java and see that 6 is in between 5 and 10..so its score is 2. if it's 12. It's between 10 and 15 and the score is 3.
Or maybe instead of a table in the database, I could save the lookup values in a class ? Is there a more efficient way to do this ?