enhance sql queries