Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: there are no wins when the top 25 and even the top 10 are less than 4

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 'wins' is equal to 0.

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

Step 3: Select rows where 'top___10' is less than 4.

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

Step 1: Select rows where 'wins' is equal to 0.

SQL command for the step:

SELECT * FROM table_sql WHERE wins = 0;
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
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 3: Select rows where 'top___10' is less than 4.

SQL command for the step:

SELECT * FROM table_sql WHERE top___10 < 4;
tournament wins top___5 top___10 top___25 events cuts_made
us open 0 0 1 3 8 6
the open championship 0 1 1 2 8 6

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

SQL command for the step:

SELECT CASE WHEN (SELECT COUNT(*) FROM table_sql) = (SELECT COUNT(*) FROM table_sql) THEN TRUE ELSE FALSE END AS verification;
tournament wins top___5 top___10 top___25 events cuts_made
us open 0 0 1 3 8 6
the open championship 0 1 1 2 8 6

Verification:

The statement is TRUE