Plan-of-SQLs Interface FP

Task: Verify the Statement against the Table

Statement: before 2009 was the only year that reasons to be pretty had a nominee at the drama desk award ceremony

Table: reasons to be pretty

year award_ceremony category nominee result
2009 tony award best play neil labute nominated
2009 tony award best performance by a leading actor in a play thomas sadoski nominated
2009 tony award best performance by a featured actress in a play marin ireland nominated
2009 drama desk award outstanding play outstanding play nominated
2009 drama desk award outstanding actor in a play thomas sadoski nominated
2009 drama desk award outstanding director of a play terry kinney nominated
2009 theatre world award theatre world award marin ireland won
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'award_ceremony' is 'drama desk award'.

Step 2: Select rows where 'year' is before 2009.

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

Step 1: Select rows where 'award_ceremony' is 'drama desk award'.

SQL command for the step:

SELECT * FROM table_sql WHERE award_ceremony = 'drama desk award';
year award_ceremony category nominee result
2009 tony award best play neil labute nominated
2009 tony award best performance by a leading actor in a play thomas sadoski nominated
2009 tony award best performance by a featured actress in a play marin ireland nominated
2009 drama desk award outstanding play outstanding play nominated
2009 drama desk award outstanding actor in a play thomas sadoski nominated
2009 drama desk award outstanding director of a play terry kinney nominated
2009 theatre world award theatre world award marin ireland won

Step 2: Select rows where 'year' is before 2009.

SQL command for the step:

SELECT * FROM table_sql WHERE year < 2009;
year award_ceremony category nominee result
2009 drama desk award outstanding play outstanding play nominated
2009 drama desk award outstanding actor in a play thomas sadoski nominated
2009 drama desk award outstanding director of a play terry kinney nominated

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

SQL command for the step:

SELECT CASE WHEN COUNT(*) = 0 THEN TRUE ELSE FALSE END AS verification FROM table_sql;
year award_ceremony category nominee result

Verification:

The statement is TRUE