Added changes to insert/check sql queries for mysql