Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: the date of vacancy when the position in the table is 10th and the manner of departure was resigned is 28 february 2011

Table: 2010 - 11 primeira liga

team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
união de leiria lito vidigal sacked 2010-07-07 off - season pedro caixinha 2010-07-10
marítimo mitchell van der gaag sacked 2010-09-14 15th pedro martins 2010-09-14
naval 1 de maio victor zvunka sacked 2010-09-27 14th rogério gonçalves 2010-10-06
académica jorge costa resigned 2010-12-21 9th josé guilherme 2010-12-27
naval 1 de maio rogério gonçalves sacked 2010-12-19 16th carlos mozer 2010-12-30
portimonense litos sacked 2011-12-28 16th carlos azenha 2010-12-29
académica josé guilherme resigned 2011-02-20 13th ulisses morais 2011-02-22
sporting paulo sérgio resigned 2011-02-26 3rd josé couceiro 2011-02-26
beira - mar leonardo jardim resigned 2011-02-28 10th rui bento 2011-03-01
vitória de setúbal manuel fernandes sacked 2011-03-01 14th bruno ribeiro 2011-03-01
Generating plan to answer the query...

Generated steps

Step 1: Select rows where the 'position_in_table' is '10th'.

Step 2: Select rows where the 'manner_of_departure' is 'resigned'.

Step 3: Select rows where the 'date_of_vacancy' is '2011-02-28'.

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 'position_in_table' is '10th'.

SQL command for the step:

SELECT * FROM table_sql WHERE position_in_table = '10th';
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
união de leiria lito vidigal sacked 2010-07-07 off - season pedro caixinha 2010-07-10
marítimo mitchell van der gaag sacked 2010-09-14 15th pedro martins 2010-09-14
naval 1 de maio victor zvunka sacked 2010-09-27 14th rogério gonçalves 2010-10-06
académica jorge costa resigned 2010-12-21 9th josé guilherme 2010-12-27
naval 1 de maio rogério gonçalves sacked 2010-12-19 16th carlos mozer 2010-12-30
portimonense litos sacked 2011-12-28 16th carlos azenha 2010-12-29
académica josé guilherme resigned 2011-02-20 13th ulisses morais 2011-02-22
sporting paulo sérgio resigned 2011-02-26 3rd josé couceiro 2011-02-26
beira - mar leonardo jardim resigned 2011-02-28 10th rui bento 2011-03-01
vitória de setúbal manuel fernandes sacked 2011-03-01 14th bruno ribeiro 2011-03-01

Step 2: Select rows where the 'manner_of_departure' is 'resigned'.

SQL command for the step:

SELECT * FROM table_sql WHERE manner_of_departure = 'resigned';
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
beira - mar leonardo jardim resigned 2011-02-28 10th rui bento 2011-03-01

Step 3: Select rows where the 'date_of_vacancy' is '2011-02-28'.

SQL command for the step:

SELECT * FROM table_sql WHERE date_of_vacancy = '2011-02-28';
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
beira - mar leonardo jardim resigned 2011-02-28 10th rui bento 2011-03-01

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;
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
beira - mar leonardo jardim resigned 2011-02-28 10th rui bento 2011-03-01

Verification:

The statement is TRUE