Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: jerry mitchell was nominated for a drama desk award three times

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 'nominee' is 'jerry mitchell'.

Step 2: Select rows where 'award' is 'drama desk award'.

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

Step 1: 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 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 'award' is 'drama desk award'.

SQL command for the step:

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

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

SQL command for the step:

SELECT CASE WHEN COUNT(*) = 3 THEN TRUE ELSE FALSE END AS verification FROM table_sql;
year award category nominee result
2005 drama desk award outstanding choreography jerry mitchell won

Verification:

The statement is FALSE