Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: jerry mitchell is one of three nominees for a drama desk award

Table: la cage aux folles (musical)

year award category nominee result
2005 tony award best revival of a musical best revival of a musical won
2005 tony award best performance by a leading actor in a musical gary beach nominated
2005 tony award best choreography jerry mitchell won
2005 tony award best costume design william ivey long nominated
2005 drama desk award outstanding revival of a musical outstanding revival of a musical won
2005 drama desk award outstanding choreography jerry mitchell won
2005 drama desk award outstanding costume design william ivey long nominated
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'category' is 'best choreography'.

Step 2: Select rows where 'nominee' is 'jerry mitchell'.

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 'category' is 'best choreography'.

SQL command for the step:

SELECT * FROM table_sql WHERE category = 'best choreography';
year award category nominee result
2005 tony award best revival of a musical best revival of a musical won
2005 tony award best performance by a leading actor in a musical gary beach nominated
2005 tony award best choreography jerry mitchell won
2005 tony award best costume design william ivey long nominated
2005 drama desk award outstanding revival of a musical outstanding revival of a musical won
2005 drama desk award outstanding choreography jerry mitchell won
2005 drama desk award outstanding costume design william ivey long nominated

Step 2: Select rows where 'nominee' is 'jerry mitchell'.

SQL command for the step:

SELECT * FROM table_sql WHERE nominee = 'jerry mitchell';
year award category nominee result
2005 tony award best choreography jerry mitchell won

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;
year award category nominee result
2005 tony award best choreography jerry mitchell won

Verification:

The statement is TRUE