Changed sql to mysql
Improved mysql syntax