Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: there are no defensive end picks and an overall smaller than 2

Table: jacksonville jaguars draft history

round pick overall name position college
1 2 2 kevin hardy linebacker illinois
2 3 33 tony brackens defensive end texas
2 30 60 michael cheever center georgia tech
3 2 63 aaron beasley cornerback west virginia
4 15 110 reggie barlow wide receiver alabama state
5 14 146 jimmy herndon guard houston
6 3 170 john fisher defensive back missouri western
6 18 185 chris doering wide receiver florida
7 18 227 clarence jones wide receiver tennessee state
7 19 228 gregory spann wide receiver jackson state
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'position' is 'defensive end'.

Step 2: Select rows where 'overall' is smaller than 2.

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 'position' is 'defensive end'.

SQL command for the step:

SELECT * FROM table_sql WHERE position = 'defensive end';
round pick overall name position college
1 2 2 kevin hardy linebacker illinois
2 3 33 tony brackens defensive end texas
2 30 60 michael cheever center georgia tech
3 2 63 aaron beasley cornerback west virginia
4 15 110 reggie barlow wide receiver alabama state
5 14 146 jimmy herndon guard houston
6 3 170 john fisher defensive back missouri western
6 18 185 chris doering wide receiver florida
7 18 227 clarence jones wide receiver tennessee state
7 19 228 gregory spann wide receiver jackson state

Step 2: Select rows where 'overall' is smaller than 2.

SQL command for the step:

SELECT * FROM table_sql WHERE overall < 2;
round pick overall name position college
2 3 33 tony brackens defensive end texas

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;
round pick overall name position college

Verification:

The statement is TRUE