Update the mysql queries for extracting the SAD data.