Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: the chicago black hawks are the only opponent with 63 points

Table: none

game march opponent score record points
63 9999-01-04 detroit red wings 2 - 2 24 - 28 - 11 59
64 9999-01-06 california golden seals 4 - 4 24 - 28 - 12 60
65 9999-01-07 minnesota north stars 1 - 3 24 - 29 - 12 60
66 9999-01-10 pittsburgh penguins 2 - 2 24 - 29 - 13 61
67 9999-01-12 new york rangers 2 - 7 24 - 30 - 13 61
68 9999-01-13 toronto maple leafs 3 - 2 25 - 30 - 13 63
69 9999-01-18 new york rangers 2 - 1 26 - 30 - 13 65
70 9999-01-20 boston bruins 3 - 5 26 - 31 - 13 65
71 9999-01-21 toronto maple leafs 1 - 1 26 - 31 - 14 66
72 9999-01-24 montreal canadiens 3 - 5 26 - 32 - 14 66
73 9999-01-25 minnesota north stars 2 - 2 26 - 32 - 15 67
74 9999-01-27 chicago black hawks 1 - 3 26 - 33 - 15 67
75 9999-01-28 pittsburgh penguins 3 - 1 27 - 33 - 15 69
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'opponent' is 'chicago black hawks'.

Step 2: Select rows where 'points' is 63.

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

Step 1: Select rows where 'opponent' is 'chicago black hawks'.

SQL command for the step:

SELECT * FROM table_sql WHERE opponent = 'chicago black hawks';
game march opponent score record points
63 9999-01-04 detroit red wings 2 - 2 24 - 28 - 11 59
64 9999-01-06 california golden seals 4 - 4 24 - 28 - 12 60
65 9999-01-07 minnesota north stars 1 - 3 24 - 29 - 12 60
66 9999-01-10 pittsburgh penguins 2 - 2 24 - 29 - 13 61
67 9999-01-12 new york rangers 2 - 7 24 - 30 - 13 61
68 9999-01-13 toronto maple leafs 3 - 2 25 - 30 - 13 63
69 9999-01-18 new york rangers 2 - 1 26 - 30 - 13 65
70 9999-01-20 boston bruins 3 - 5 26 - 31 - 13 65
71 9999-01-21 toronto maple leafs 1 - 1 26 - 31 - 14 66
72 9999-01-24 montreal canadiens 3 - 5 26 - 32 - 14 66
73 9999-01-25 minnesota north stars 2 - 2 26 - 32 - 15 67
74 9999-01-27 chicago black hawks 1 - 3 26 - 33 - 15 67
75 9999-01-28 pittsburgh penguins 3 - 1 27 - 33 - 15 69

Step 2: Select rows where 'points' is 63.

SQL command for the step:

SELECT * FROM table_sql WHERE points = 63;
game march opponent score record points
74 9999-01-27 chicago black hawks 1 - 3 26 - 33 - 15 67

Step 3: 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 march opponent score record points

Verification:

The statement is FALSE