updated mysql queries for systems