an attempt to write sql queries consisely