Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: reasons to be pretty was nominated for best play more than one time

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

Step 2: Select rows where 'nominee' is 'reasons to be pretty'.

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

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

SQL command for the step:

SELECT * FROM table_sql WHERE category = 'best play';
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 'nominee' is 'reasons to be pretty'.

SQL command for the step:

SELECT * FROM table_sql WHERE nominee = 'reasons to be pretty';
year award_ceremony category nominee result
2009 tony award best play neil labute nominated

Step 3: Use a `CASE` statement to return TRUE if the number of rows is greater than 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_ceremony category nominee result

Verification:

The statement is FALSE