Plan-of-SQLs Interface FN

Task: Verify the Statement against the Table

Statement: player will bynum (5) scored the highest number of assists in the game and the attendance was 11747 people at the carrier dome

Table: 2010 - 11 detroit pistons season

game date team score high_points high_rebounds high_assists location_attendance record
1 9999-10-05 miami l 89 - 105 (ot) ben gordon (17) ben gordon , charlie villanueva (5) rodney stuckey (5) american airlines arena 19600 0 - 1
2 9999-10-08 milwaukee w 115 - 110 (ot) austin daye (21) austin daye (7) will bynum (9) the palace of auburn hills 12821 1 - 1
3 9999-10-11 atlanta w 94 - 85 (ot) rodney stuckey (16) greg monroe (7) richard hamilton (7) the palace of auburn hills 10591 2 - 1
4 9999-10-13 dallas l 96 - 101 (ot) austin daye (16) ben wallace , jason maxiell (8) rodney stuckey (6) van andel arena 10207 2 - 2
5 9999-10-15 minnesota l 88 - 99 (ot) austin daye (18) austin daye (11) will bynum (5) carrier dome 11747 2 - 3
6 9999-10-16 charlotte l 94 - 97 (ot) rodney stuckey (25) greg monroe (8) rodney stuckey , will bynum (5) colonial life arena 6847 2 - 4
7 9999-10-19 washington w 98 - 92 (ot) rodney stuckey (34) ben wallace (11) rodney stuckey (7) huntington center 6424 3 - 4
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'player' is 'will bynum'.

Step 2: Select rows where 'high_assists' is greater than or equal to 5.

Step 3: Select rows where 'attendance' is 11747.

Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.

Step 1: Select rows where 'player' is 'will bynum'.

SQL command for the step:

SELECT * FROM table_sql WHERE player = 'will bynum';
game date team score high_points high_rebounds high_assists location_attendance record
1 9999-10-05 miami l 89 - 105 (ot) ben gordon (17) ben gordon , charlie villanueva (5) rodney stuckey (5) american airlines arena 19600 0 - 1
2 9999-10-08 milwaukee w 115 - 110 (ot) austin daye (21) austin daye (7) will bynum (9) the palace of auburn hills 12821 1 - 1
3 9999-10-11 atlanta w 94 - 85 (ot) rodney stuckey (16) greg monroe (7) richard hamilton (7) the palace of auburn hills 10591 2 - 1
4 9999-10-13 dallas l 96 - 101 (ot) austin daye (16) ben wallace , jason maxiell (8) rodney stuckey (6) van andel arena 10207 2 - 2
5 9999-10-15 minnesota l 88 - 99 (ot) austin daye (18) austin daye (11) will bynum (5) carrier dome 11747 2 - 3
6 9999-10-16 charlotte l 94 - 97 (ot) rodney stuckey (25) greg monroe (8) rodney stuckey , will bynum (5) colonial life arena 6847 2 - 4
7 9999-10-19 washington w 98 - 92 (ot) rodney stuckey (34) ben wallace (11) rodney stuckey (7) huntington center 6424 3 - 4

Step 2: Select rows where 'high_assists' is greater than or equal to 5.

SQL command for the step:

SELECT * FROM table_sql WHERE high_assists >= 5;
game date team score high_points high_rebounds high_assists location_attendance record
2 9999-10-08 milwaukee w 115 - 110 (ot) austin daye (21) austin daye (7) will bynum (9) the palace of auburn hills 12821 1 - 1
5 9999-10-15 minnesota l 88 - 99 (ot) austin daye (18) austin daye (11) will bynum (5) carrier dome 11747 2 - 3
6 9999-10-16 charlotte l 94 - 97 (ot) rodney stuckey (25) greg monroe (8) rodney stuckey , will bynum (5) colonial life arena 6847 2 - 4

Step 3: Select rows where 'attendance' is 11747.

SQL command for the step:

SELECT * FROM table_sql WHERE attendance = 11747;
game date team score high_points high_rebounds high_assists location_attendance record

Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.

SQL command for the step:

SELECT CASE WHEN COUNT(*) = 1 THEN TRUE ELSE FALSE END AS verification FROM table_sql;
game date team score high_points high_rebounds high_assists location_attendance record

Verification:

The statement is FALSE