sql connection and python dictionary done, next write sql query