Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: in the year 2007 the regional gva was 9432 and the industry was listed as 1565

Table: none

year regional_gva agriculture industry services
1995 4753 11 1110 3632
2000 6584 10 1302 5277
2003 8201 11 1374 6816
2005 8978 11 1465 7502
2007 9432 11 1565 7856
Generating plan to answer the query...

Generated steps

Step 1: Select rows where the 'year' is 2007.

Step 2: Select rows where the 'regional_gva' is 9432.

Step 3: Select rows where the 'industry' is 1565.

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

Step 1: Select rows where the 'year' is 2007.

SQL command for the step:

SELECT * FROM table_sql WHERE year = 2007;
year regional_gva agriculture industry services
1995 4753 11 1110 3632
2000 6584 10 1302 5277
2003 8201 11 1374 6816
2005 8978 11 1465 7502
2007 9432 11 1565 7856

Step 2: Select rows where the 'regional_gva' is 9432.

SQL command for the step:

SELECT * FROM table_sql WHERE regional_gva = 9432;
year regional_gva agriculture industry services
2007 9432 11 1565 7856

Step 3: Select rows where the 'industry' is 1565.

SQL command for the step:

SELECT * FROM table_sql WHERE industry = 1565;
year regional_gva agriculture industry services
2007 9432 11 1565 7856

Step 4: 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;
year regional_gva agriculture industry services
2007 9432 11 1565 7856

Verification:

The statement is TRUE