Plan-of-SQLs Interface FP

Task: Verify the Statement against the Table

Statement: gary beach is one of four winners of a tony 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 'nominee' is 'gary beach'.

Step 2: Select rows where 'award' is 'tony award'.

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 'nominee' is 'gary beach'.

SQL command for the step:

SELECT * FROM table_sql WHERE nominee = 'gary beach';
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 'tony award'.

SQL command for the step:

SELECT * FROM table_sql WHERE award = 'tony award';
year award category nominee result
2005 tony award best performance by a leading actor in a musical gary beach nominated

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 performance by a leading actor in a musical gary beach nominated

Verification:

The statement is TRUE