Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: zoë wanamaker plays the character ariadne oliver

Table: list of agatha christie 's poirot episodes

actor character title___rank series years
david suchet hercule poirot various 1 - 13 1989 - 2013
hugh fraser arthur hastings captain obe 1 - 8 , 13 1989 - 2002 , 2013
philip jackson james japp chief inspector 1 - 8 , 13 1989 - 2001 , 2013
pauline moran felicity lemon secretary 1 - 3 , 5 - 8 , 13 1989 - 1991 , 1993 - 2001 , 2013
zoë wanamaker ariadne oliver crime novelist 10 - 13 2006 - 2013
david yelland george butler 10 - 13 2006 - 2013
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'character' is 'ariadne oliver'.

Step 2: Select rows where 'actor' is 'zoë wanamaker'.

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 'character' is 'ariadne oliver'.

SQL command for the step:

SELECT * FROM table_sql WHERE character = 'ariadne oliver';
actor character title___rank series years
david suchet hercule poirot various 1 - 13 1989 - 2013
hugh fraser arthur hastings captain obe 1 - 8 , 13 1989 - 2002 , 2013
philip jackson james japp chief inspector 1 - 8 , 13 1989 - 2001 , 2013
pauline moran felicity lemon secretary 1 - 3 , 5 - 8 , 13 1989 - 1991 , 1993 - 2001 , 2013
zoë wanamaker ariadne oliver crime novelist 10 - 13 2006 - 2013
david yelland george butler 10 - 13 2006 - 2013

Step 2: Select rows where 'actor' is 'zoë wanamaker'.

SQL command for the step:

SELECT * FROM table_sql WHERE actor = 'zoë wanamaker';
actor character title___rank series years
zoë wanamaker ariadne oliver crime novelist 10 - 13 2006 - 2013

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;
actor character title___rank series years
zoë wanamaker ariadne oliver crime novelist 10 - 13 2006 - 2013

Verification:

The statement is TRUE