how to write mysql query in shell script