Let\'s say Point table looks like this,
point_table - id (pk) - amount (Integer) - used_amount (Integer)
And I write sql like below