Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: the date of vacancy is 28 december 2011 with the incoming head coach being carlos azenha

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 'date_of_vacancy' is '2011-12-28'.

Step 2: Select rows where 'incoming_head_coach' is 'carlos azenha'.

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 'date_of_vacancy' is '2011-12-28'.

SQL command for the step:

SELECT * FROM table_sql WHERE date_of_vacancy = '2011-12-28';
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 'incoming_head_coach' is 'carlos azenha'.

SQL command for the step:

SELECT * FROM table_sql WHERE incoming_head_coach = 'carlos azenha';
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
portimonense litos sacked 2011-12-28 16th carlos azenha 2010-12-29

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;
team outgoing_head_coach manner_of_departure date_of_vacancy position_in_table incoming_head_coach date_of_appointment
portimonense litos sacked 2011-12-28 16th carlos azenha 2010-12-29

Verification:

The statement is TRUE