Plan-of-SQLs Interface TN

Task: Verify the Statement against the Table

Statement: 3 - 0 was the 2nd leg when san pedro was the 2nd place winner

Table: copa san isidro de curuguaty

year winner runners___up aggregate c_1st_leg c_2nd_leg
1956 trinidad liga central 4 - 2 2 - 1 2 - 1
1959 fray bentos villeta 7 - 1 3 - 0 4 - 1
1963 colonia ypacaraí 3 - 3 0 - 1 3 - 2
1966 tacuarembó coronel oviedo 4 - 1 2 - 0 2 - 1
1978 federación misionera melo 4 - 0 1 - 0 3 - 0
1980 federación misionera tacuarembó 5 - 5 , 3 - 2 p 2 - 1 3 - 4
1982 maldonado villarrica 1 - 1 , 4 - 3 p 1 - 0 0 - 1
1984 san pedro rocha 4 - 3 1 - 3 3 - 0
1988 paysandú paranaense 4 - 3 1 - 2 3 - 1
1990 ypacaraí florida 2 - 1 1 - 0 1 - 1
1992 liga del sud minas 6 - 1 2 - 0 4 - 1
1994 maldonado caaguazú 9 - 2 4 - 0 5 - 2
1996 paranaense maldonado interior 3 - 3 2 - 2 1 - 1
1998 itauguá melo 4 - 3 1 - 1 3 - 2
2000 san josé liga mayor carapeguá 2 - 2 , 4 - 2 p 1 - 1 1 - 1
2002 limpio durazno 5 - 4 5 - 4 0 - 0
2004 san josé de los arroyos durazno 4 - 3 0 - 2 4 - 1
2006 pirayú maldonado liga mayor 3 - 3 , 4 - 2 p 1 - 2 2 - 1
2008 colonia departamental caaguazú 4 - 2 3 - 1 1 - 1
2008 liga caacupeña artigas 3 - 1 1 - 1 2 - 0
Generating plan to answer the query...

Generated steps

Step 1: Select rows where 'c_2nd_leg' is '3 - 0'.

Step 2: Select rows where 'runners___up' is 'san pedro'.

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

Step 1: Select rows where 'c_2nd_leg' is '3 - 0'.

SQL command for the step:

SELECT * FROM table_sql WHERE c_2nd_leg = '3 - 0';
year winner runners___up aggregate c_1st_leg c_2nd_leg
1956 trinidad liga central 4 - 2 2 - 1 2 - 1
1959 fray bentos villeta 7 - 1 3 - 0 4 - 1
1963 colonia ypacaraí 3 - 3 0 - 1 3 - 2
1966 tacuarembó coronel oviedo 4 - 1 2 - 0 2 - 1
1978 federación misionera melo 4 - 0 1 - 0 3 - 0
1980 federación misionera tacuarembó 5 - 5 , 3 - 2 p 2 - 1 3 - 4
1982 maldonado villarrica 1 - 1 , 4 - 3 p 1 - 0 0 - 1
1984 san pedro rocha 4 - 3 1 - 3 3 - 0
1988 paysandú paranaense 4 - 3 1 - 2 3 - 1
1990 ypacaraí florida 2 - 1 1 - 0 1 - 1
1992 liga del sud minas 6 - 1 2 - 0 4 - 1
1994 maldonado caaguazú 9 - 2 4 - 0 5 - 2
1996 paranaense maldonado interior 3 - 3 2 - 2 1 - 1
1998 itauguá melo 4 - 3 1 - 1 3 - 2
2000 san josé liga mayor carapeguá 2 - 2 , 4 - 2 p 1 - 1 1 - 1
2002 limpio durazno 5 - 4 5 - 4 0 - 0
2004 san josé de los arroyos durazno 4 - 3 0 - 2 4 - 1
2006 pirayú maldonado liga mayor 3 - 3 , 4 - 2 p 1 - 2 2 - 1
2008 colonia departamental caaguazú 4 - 2 3 - 1 1 - 1
2008 liga caacupeña artigas 3 - 1 1 - 1 2 - 0

Step 2: Select rows where 'runners___up' is 'san pedro'.

SQL command for the step:

SELECT * FROM table_sql WHERE runners___up = 'san pedro';
year winner runners___up aggregate c_1st_leg c_2nd_leg
1978 federación misionera melo 4 - 0 1 - 0 3 - 0
1984 san pedro rocha 4 - 3 1 - 3 3 - 0

Step 3: 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 winner runners___up aggregate c_1st_leg c_2nd_leg

Verification:

The statement is FALSE