amended MySQL database schema queries for greater scalability