Added job queue SQL

Main code rev. 1943