Plan-of-SQLs Interface TP

Task: Verify the Statement against the Table

Statement: when the team is união de leiria , the date of appointment is 10 july 2010

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 'team' is 'união de leiria'.

Step 2: Select rows where the 'date_of_appointment' is '2010-07-10'.

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 the 'team' is 'união de leiria'.

SQL command for the step:

SELECT * FROM table_sql WHERE team = 'união de leiria';
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 'date_of_appointment' is '2010-07-10'.

SQL command for the step:

SELECT * FROM table_sql WHERE date_of_appointment = '2010-07-10';
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

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
união de leiria lito vidigal sacked 2010-07-07 off - season pedro caixinha 2010-07-10

Verification:

The statement is TRUE