Convert Excel sheet to MySQL query