Hopefully final version of update.sql, query.sql, updateLogSmall.sql, and queryLogSmall.sql