Updated SQL to the latest spec