Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: pga championship when top - 25 is less than 4 has 0 wins with cuts made 6 and top - 5 is greater than 0

Table: chris dimarco

tournament wins top___5 top___10 top___25 events cuts_made
masters tournament 0 1 3 4 7 4
us open 0 0 1 3 8 6
the open championship 0 1 1 2 8 6
pga championship 0 1 1 4 10 8
totals 0 3 6 13 33 24
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'tournament' is 'pga championship'.

Step 2: Select rows where 'top___25' is less than 4.

Step 3: Select rows where 'wins' is 0.

Step 4: Select rows where 'cuts_made' is 6.

Step 5: Select rows where 'top___5' is greater than 0.

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

Step 1: Select rows where 'tournament' is 'pga championship'.

SQL command for the step:

SELECT * FROM table_sql WHERE tournament = 'pga championship';
tournament wins top___5 top___10 top___25 events cuts_made
masters tournament 0 1 3 4 7 4
us open 0 0 1 3 8 6
the open championship 0 1 1 2 8 6
pga championship 0 1 1 4 10 8
totals 0 3 6 13 33 24

Step 2: Select rows where 'top___25' is less than 4.

SQL command for the step:

SELECT * FROM table_sql WHERE top___25 < 4;
tournament wins top___5 top___10 top___25 events cuts_made
pga championship 0 1 1 4 10 8

Step 3: Select rows where 'wins' is 0.

SQL command for the step:

SELECT * FROM table_sql WHERE wins = 0;
tournament wins top___5 top___10 top___25 events cuts_made

Step 4: Select rows where 'cuts_made' is 6.

SQL command for the step:

SELECT * FROM table_sql WHERE cuts_made = 6;
tournament wins top___5 top___10 top___25 events cuts_made

Step 5: Select rows where 'top___5' is greater than 0.

SQL command for the step:

SELECT * FROM table_sql WHERE top___5 > 0;
tournament wins top___5 top___10 top___25 events cuts_made

Step 6: 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;
tournament wins top___5 top___10 top___25 events cuts_made

Verification:

The statement is FALSE