Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: when michael beade was the highest scorer , the score was w 97 - 92 (ot)

Table: 2008 - 09 miami heat season

game date team score high_points high_rebounds high_assists location_attendance record
75 9999-04-01 dallas l 96 - 98 (ot) dwyane wade (23) jermaine o'neal , udonis haslem (7) dwyane wade (6) american airlines center 20021 39 - 36
76 9999-04-03 charlotte w 97 - 92 (ot) dwyane wade (27) daequan cook (7) dwyane wade (10) time warner cable arena 19568 40 - 36
77 9999-04-04 washington w 118 - 104 (ot) dwyane wade (33) jermaine o'neal , jamaal magloire (6) dwyane wade (8) verizon center 20173 41 - 36
78 '9999-04-07' new orleans l 87 - 93 (ot) dwyane wade (32) jamaal magloire (10) dwyane wade (6) american airlines arena 19600 41 - 37
79 '9999-04-10' boston l 98 - 105 (ot) dwyane wade (31) michael beasley (13) dwyane wade (9) td banknorth garden 18624 41 - 38
80 '9999-04-12' new york w 122 - 105 (ot) dwyane wade (55) michael beasley (16) mario chalmers (9) american airlines arena 19600 42 - 38
81 9999-04-14 atlanta l 79 - 81 (ot) michael beasley (23) michael beasley (13) chris quinn (7) philips arena 42 - 39
82 '9999-04-15' detroit w 102 - 96 (ot) chris quinn (26) dorell wright (10) mario chalmers (10) american airlines arena 43 - 39
Generating plan to answer the query...

Generated steps

Step 1: Order the table by 'high_points' in descending order.

Step 2: Select row number 1.

Step 3: Select rows where 'score' is 'w 97 - 92 (ot)'.

Step 4: Select rows where 'high_points' is 'michael beasley'.

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

Step 1: Order the table by 'high_points' in descending order.

SQL command for the step:

SELECT * FROM table_sql ORDER BY high_points DESC;
game date team score high_points high_rebounds high_assists location_attendance record
75 9999-04-01 dallas l 96 - 98 (ot) dwyane wade (23) jermaine o'neal , udonis haslem (7) dwyane wade (6) american airlines center 20021 39 - 36
76 9999-04-03 charlotte w 97 - 92 (ot) dwyane wade (27) daequan cook (7) dwyane wade (10) time warner cable arena 19568 40 - 36
77 9999-04-04 washington w 118 - 104 (ot) dwyane wade (33) jermaine o'neal , jamaal magloire (6) dwyane wade (8) verizon center 20173 41 - 36
78 '9999-04-07' new orleans l 87 - 93 (ot) dwyane wade (32) jamaal magloire (10) dwyane wade (6) american airlines arena 19600 41 - 37
79 '9999-04-10' boston l 98 - 105 (ot) dwyane wade (31) michael beasley (13) dwyane wade (9) td banknorth garden 18624 41 - 38
80 '9999-04-12' new york w 122 - 105 (ot) dwyane wade (55) michael beasley (16) mario chalmers (9) american airlines arena 19600 42 - 38
81 9999-04-14 atlanta l 79 - 81 (ot) michael beasley (23) michael beasley (13) chris quinn (7) philips arena 42 - 39
82 '9999-04-15' detroit w 102 - 96 (ot) chris quinn (26) dorell wright (10) mario chalmers (10) american airlines arena 43 - 39

Step 2: Select row number 1.

SQL command for the step:

SELECT * FROM table_sql LIMIT 1;
game date team score high_points high_rebounds high_assists location_attendance record points
80 '9999-04-12' new york w 122 - 105 (ot) dwyane wade (55) michael beasley (16) mario chalmers (9) american airlines arena 19600 42 - 38 55
77 9999-04-04 washington w 118 - 104 (ot) dwyane wade (33) jermaine o'neal , jamaal magloire (6) dwyane wade (8) verizon center 20173 41 - 36 33
78 '9999-04-07' new orleans l 87 - 93 (ot) dwyane wade (32) jamaal magloire (10) dwyane wade (6) american airlines arena 19600 41 - 37 32
79 '9999-04-10' boston l 98 - 105 (ot) dwyane wade (31) michael beasley (13) dwyane wade (9) td banknorth garden 18624 41 - 38 31
76 9999-04-03 charlotte w 97 - 92 (ot) dwyane wade (27) daequan cook (7) dwyane wade (10) time warner cable arena 19568 40 - 36 27
82 '9999-04-15' detroit w 102 - 96 (ot) chris quinn (26) dorell wright (10) mario chalmers (10) american airlines arena 43 - 39 26
75 9999-04-01 dallas l 96 - 98 (ot) dwyane wade (23) jermaine o'neal , udonis haslem (7) dwyane wade (6) american airlines center 20021 39 - 36 23
81 9999-04-14 atlanta l 79 - 81 (ot) michael beasley (23) michael beasley (13) chris quinn (7) philips arena 42 - 39 23

Step 3: Select rows where 'score' is 'w 97 - 92 (ot)'.

SQL command for the step:

SELECT * FROM table_sql WHERE score = 'w 97 - 92 (ot)';
game date team score high_points high_rebounds high_assists location_attendance record points
80 '9999-04-12' new york w 122 - 105 (ot) dwyane wade (55) michael beasley (16) mario chalmers (9) american airlines arena 19600 42 - 38 55

Step 4: Select rows where 'high_points' is 'michael beasley'.

SQL command for the step:

SELECT * FROM table_sql WHERE high_points = 'michael beasley';
game date team score high_points high_rebounds high_assists location_attendance record points

Step 5: 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 points

Verification:

The statement is FALSE