Helping function to use insert/delete/update query.