Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: in 2012 , the oakland raiders lost to the kansas city chiefs at arrowhead stadium with a result of 15 - 0

Table: chiefs - raiders rivalry

year date winner result loser location
2010 9999-11-07 oakland raiders 23 - 20 (ot) kansas city chiefs oakland - alameda county coliseum
2010 2011-01-02 oakland raiders 31 - 10 kansas city chiefs arrowhead stadium
2011 9999-10-23 kansas city chiefs 28 - 0 oakland raiders oco coliseum
2011 9999-12-24 oakland raiders 16 - 13 (ot) kansas city chiefs arrowhead stadium
2012 9999-10-28 oakland raiders 26 - 16 kansas city chiefs arrowhead stadium
2012 9999-12-16 oakland raiders 15 - 0 kansas city chiefs oco coliseum
2013 9999-10-13 kansas city chiefs 24 - 7 oakland raiders arrowhead stadium
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'year' is 2012.

Step 2: Select rows where 'location' is 'arrowhead stadium'.

Step 3: Select rows where 'result' is '15 - 0'.

Step 4: Select rows where 'winner' is 'kansas city chiefs'.

Step 5: Select rows where 'loser' is 'oakland raiders'.

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

Step 1: Select rows where 'year' is 2012.

SQL command for the step:

SELECT * FROM table_sql WHERE year = 2012;
year date winner result loser location
2010 9999-11-07 oakland raiders 23 - 20 (ot) kansas city chiefs oakland - alameda county coliseum
2010 2011-01-02 oakland raiders 31 - 10 kansas city chiefs arrowhead stadium
2011 9999-10-23 kansas city chiefs 28 - 0 oakland raiders oco coliseum
2011 9999-12-24 oakland raiders 16 - 13 (ot) kansas city chiefs arrowhead stadium
2012 9999-10-28 oakland raiders 26 - 16 kansas city chiefs arrowhead stadium
2012 9999-12-16 oakland raiders 15 - 0 kansas city chiefs oco coliseum
2013 9999-10-13 kansas city chiefs 24 - 7 oakland raiders arrowhead stadium

Step 2: Select rows where 'location' is 'arrowhead stadium'.

SQL command for the step:

SELECT * FROM table_sql WHERE location = 'arrowhead stadium';
year date winner result loser location
2012 9999-10-28 oakland raiders 26 - 16 kansas city chiefs arrowhead stadium
2012 9999-12-16 oakland raiders 15 - 0 kansas city chiefs oco coliseum

Step 3: Select rows where 'result' is '15 - 0'.

SQL command for the step:

SELECT * FROM table_sql WHERE result = '15 - 0';
year date winner result loser location
2012 9999-10-28 oakland raiders 26 - 16 kansas city chiefs arrowhead stadium

Step 4: Select rows where 'winner' is 'kansas city chiefs'.

SQL command for the step:

SELECT * FROM table_sql WHERE winner = 'kansas city chiefs';
year date winner result loser location

Step 5: Select rows where 'loser' is 'oakland raiders'.

SQL command for the step:

SELECT * FROM table_sql WHERE loser = 'oakland raiders';
year date winner result loser location

Step 6: 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;
year date winner result loser location

Verification:

The statement is FALSE