added complete sql queries