Updated sql to match pgn field names