Stripe interview question

design a function min_by_col from a database, need to write Comparator yourself