Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: ny rangers were the visitor to vancouver on february 24

Table: 1992 - 93 vancouver canucks season

date visitor score home decision attendance record
01-02-9999 minnesota 5 - 4 vancouver mclean 14830 29 - 15 - 8
9999-02-03 tampa bay 2 - 4 vancouver whitmore 14171 30 - 15 - 8
9999-02-09 vancouver 5 - 1 quebec mclean 14360 31 - 15 - 8
01-02-11 vancouver 2 - 5 toronto mclean 15720 31 - 16 - 8
01-02-12 vancouver 3 - 1 buffalo whitmore 16325 32 - 16 - 8
01-02-15 vancouver 0 - 3 los angeles mclean 16005 32 - 17 - 8
9999-02-18 philadelphia 3 - 2 vancouver whitmore 16150 32 - 18 - 8
9999-02-20 winnipeg 2 - 4 vancouver mclean 16150 33 - 18 - 8
9999-02-22 toronto 8 - 1 vancouver mclean 16150 33 - 19 - 8
9999-02-24 ny rangers 4 - 5 vancouver whitmore 16150 34 - 19 - 8
9999-02-26 vancouver 7 - 4 winnipeg mclean 15398 35 - 19 - 8
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'visitor' is 'ny rangers'.

Step 2: Select rows where 'home' is 'vancouver'.

Step 3: Select rows where the date is '9999-02-24'.

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 'visitor' is 'ny rangers'.

SQL command for the step:

SELECT * FROM table_sql WHERE visitor = 'ny rangers';
date visitor score home decision attendance record
01-02-9999 minnesota 5 - 4 vancouver mclean 14830 29 - 15 - 8
9999-02-03 tampa bay 2 - 4 vancouver whitmore 14171 30 - 15 - 8
9999-02-09 vancouver 5 - 1 quebec mclean 14360 31 - 15 - 8
01-02-11 vancouver 2 - 5 toronto mclean 15720 31 - 16 - 8
01-02-12 vancouver 3 - 1 buffalo whitmore 16325 32 - 16 - 8
01-02-15 vancouver 0 - 3 los angeles mclean 16005 32 - 17 - 8
9999-02-18 philadelphia 3 - 2 vancouver whitmore 16150 32 - 18 - 8
9999-02-20 winnipeg 2 - 4 vancouver mclean 16150 33 - 18 - 8
9999-02-22 toronto 8 - 1 vancouver mclean 16150 33 - 19 - 8
9999-02-24 ny rangers 4 - 5 vancouver whitmore 16150 34 - 19 - 8
9999-02-26 vancouver 7 - 4 winnipeg mclean 15398 35 - 19 - 8

Step 2: Select rows where 'home' is 'vancouver'.

SQL command for the step:

SELECT * FROM table_sql WHERE home = 'vancouver';
date visitor score home decision attendance record
9999-02-24 ny rangers 4 - 5 vancouver whitmore 16150 34 - 19 - 8

Step 3: Select rows where the date is '9999-02-24'.

SQL command for the step:

SELECT * FROM table_sql WHERE date = '9999-02-24';
date visitor score home decision attendance record
9999-02-24 ny rangers 4 - 5 vancouver whitmore 16150 34 - 19 - 8

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;
date visitor score home decision attendance record
9999-02-24 ny rangers 4 - 5 vancouver whitmore 16150 34 - 19 - 8

Verification:

The statement is TRUE