Spaces:
Runtime error
Runtime error
| <html><head> | |
| <style> | |
| body { font-family: Arial, sans-serif; margin: 20px; } | |
| h1 { text-align: center; } | |
| .cot-title { color: blue; } | |
| .pos-title { color: green; } | |
| h2 { color: black; text-align: left; } | |
| h3 { color: black; text-align: left; } | |
| h4 { color: darkslategray; } | |
| table { width: 100%; border-collapse: collapse; margin: 20px 0; } | |
| table, th, td { border: 1px solid #ddd; padding: 8px; } | |
| th { background-color: #f2f2f2; } | |
| tr:nth-child(even) { background-color: #f9f9f9; } | |
| .highlight { background-color: #ffffcc; } | |
| .true { color: green; } | |
| .false { color: red; } | |
| .highlighted-cell { background-color: yellow; cursor: pointer; } | |
| .step-title { background-color: #f1f1f1; color: #444; padding: 10px; margin: 10px 0; font-size: 18px; border-left: 4px solid #888; } | |
| .step { display: block; } | |
| </style> | |
| </head><body> | |
| <h1 class="pos-title">Plan-of-SQLs (Ours)</h1> | |
| <hr> | |
| <h3><span>Statement:</span> the milwaukee brewers in the 2005 season played cardinals one day before reds</h3> | |
| <h3>Ground-truth:</span> TRUE</h3> | |
| <h3>Input Table: 2005 milwaukee brewers season</h3> | |
| <div class="step"> | |
| <div class="step"> | |
| <div class="step-title">Step 1: Select rows where 'opponent' is 'reds'.</div> | |
| <div id="step-1" class="content"> | |
| <table> | |
| <tr> | |
| <td>date</td> | |
| <td>opponent</td> | |
| <td>score</td> | |
| <td>loss</td> | |
| <td>attendance</td> | |
| <td>record</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-01</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">padres</span></td> | |
| <td>5 - 6</td> | |
| <td>davis (1 - 1)</td> | |
| <td>24785</td> | |
| <td>65 - 69</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-02</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">padres</span></td> | |
| <td>12 - 2</td> | |
| <td>lawrence (7 - 14)</td> | |
| <td>18231</td> | |
| <td>66 - 69</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-03</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">padres</span></td> | |
| <td>1 - 6</td> | |
| <td>obermueller (1 - 3)</td> | |
| <td>32022</td> | |
| <td>66 - 70</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-04</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">padres</span></td> | |
| <td>3 - 2</td> | |
| <td>otsuka (1 - 6)</td> | |
| <td>20042</td> | |
| <td>67 - 70</td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-05</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">6 - 1</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">belisle (3 - 7)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">16144</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">68 - 70</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-06</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">1 - 2 (10)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">de la rosa (2 - 2)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">13351</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">68 - 71</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-07</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">14 - 5</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">milton (7 - 14)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">15886</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">69 - 71</span></td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-09</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>7 - 4</td> | |
| <td>clemens (11 - 7)</td> | |
| <td>18130</td> | |
| <td>70 - 71</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-10</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>5 - 7</td> | |
| <td>ohka (10 - 8)</td> | |
| <td>24437</td> | |
| <td>70 - 72</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-11</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>4 - 2</td> | |
| <td>oswalt (17 - 12)</td> | |
| <td>17392</td> | |
| <td>71 - 72</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-13</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">diamondbacks</span></td> | |
| <td>3 - 1</td> | |
| <td>vã¡zquez (10 - 15)</td> | |
| <td>23708</td> | |
| <td>72 - 72</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-14</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">diamondbacks</span></td> | |
| <td>1 - 2 (12)</td> | |
| <td>lehr (0 - 1)</td> | |
| <td>23793</td> | |
| <td>72 - 73</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-15</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">diamondbacks</span></td> | |
| <td>14 - 2</td> | |
| <td>estes (7 - 8)</td> | |
| <td>20741</td> | |
| <td>73 - 73</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-16</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>1 - 2</td> | |
| <td>eveland (1 - 1)</td> | |
| <td>33767</td> | |
| <td>73 - 74</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-17</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>0 - 7</td> | |
| <td>obermueller (1 - 4)</td> | |
| <td>37756</td> | |
| <td>73 - 75</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-18</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">astros</span></td> | |
| <td>1 - 6</td> | |
| <td>capuano (17 - 10)</td> | |
| <td>35052</td> | |
| <td>73 - 76</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-20</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cubs</span></td> | |
| <td>5 - 3</td> | |
| <td>williams (5 - 9)</td> | |
| <td>30136</td> | |
| <td>74 - 76</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-21</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cubs</span></td> | |
| <td>7 - 6</td> | |
| <td>van buren (0 - 2)</td> | |
| <td>30049</td> | |
| <td>75 - 76</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-22</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cubs</span></td> | |
| <td>0 - 3</td> | |
| <td>helling (2 - 1)</td> | |
| <td>31137</td> | |
| <td>75 - 77</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-23</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cardinals</span></td> | |
| <td>9 - 6</td> | |
| <td>carpenter (21 - 5)</td> | |
| <td>22472</td> | |
| <td>76 - 77</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-24</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cardinals</span></td> | |
| <td>8 - 7</td> | |
| <td>mulder (16 - 8)</td> | |
| <td>33506</td> | |
| <td>77 - 77</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-25</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">cardinals</span></td> | |
| <td>0 - 2</td> | |
| <td>davis (11 - 11)</td> | |
| <td>20150</td> | |
| <td>77 - 78</td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-26</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">12 - 9</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">coffey (4 - 1)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">14412</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">78 - 78</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-27</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">6 - 2</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">claussen (10 - 10)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">28031</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">79 - 78</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-28</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">4 - 11</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">capuano (18 - 11)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">21181</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">79 - 79</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9999-09-29</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2 - 0</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">milton (8 - 15)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">13173</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">80 - 79</span></td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-30</td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">pirates</span></td> | |
| <td>6 - 5</td> | |
| <td>vogelsong (2 - 2)</td> | |
| <td>20922</td> | |
| <td>81 - 79</td> | |
| </tr> | |
| </table> | |
| </div> | |
| <hr> | |
| <div class="step"> | |
| <div class="step-title">Step 2: Extract the date from the 'date' column to add column 'game_date' to existing table.</div> | |
| <div id="step-0" class="content"> | |
| <table> | |
| <tr> | |
| <td>date</td> | |
| <td>opponent</td> | |
| <td>score</td> | |
| <td>loss</td> | |
| <td>attendance</td> | |
| <td>record</td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-05</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">6 - 1</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">belisle (3 - 7)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">16144</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">68 - 70</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-06</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1 - 2 (10)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">de la rosa (2 - 2)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">13351</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">68 - 71</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-07</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">14 - 5</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">milton (7 - 14)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">15886</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">69 - 71</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-26</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">12 - 9</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">coffey (4 - 1)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">14412</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">78 - 78</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-27</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">6 - 2</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">claussen (10 - 10)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">28031</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">79 - 78</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-28</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">4 - 11</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">capuano (18 - 11)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">21181</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">79 - 79</span></td> | |
| </tr> | |
| <tr> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">9999-09-29</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">reds</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">2 - 0</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">milton (8 - 15)</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">13173</span></td> | |
| <td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">80 - 79</span></td> | |
| </tr> | |
| </table> | |
| </div> | |
| </div> | |
| <hr> | |
| <div class="step"> | |
| <div class="step-title">Step 3: Select rows where 'game_date' is one day before the date of the game against the 'reds'.</div> | |
| <div id="step-1" class="content"> | |
| <table> | |
| <tr> | |
| <td>date</td> | |
| <td>opponent</td> | |
| <td>score</td> | |
| <td>loss</td> | |
| <td>attendance</td> | |
| <td>record</td> | |
| <td>game_date</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-05</td> | |
| <td>reds</td> | |
| <td>6 - 1</td> | |
| <td>belisle (3 - 7)</td> | |
| <td>16144</td> | |
| <td>68 - 70</td> | |
| <td>9999-09-05</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-06</td> | |
| <td>reds</td> | |
| <td>1 - 2 (10)</td> | |
| <td>de la rosa (2 - 2)</td> | |
| <td>13351</td> | |
| <td>68 - 71</td> | |
| <td>9999-09-06</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-07</td> | |
| <td>reds</td> | |
| <td>14 - 5</td> | |
| <td>milton (7 - 14)</td> | |
| <td>15886</td> | |
| <td>69 - 71</td> | |
| <td>9999-09-07</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-26</td> | |
| <td>reds</td> | |
| <td>12 - 9</td> | |
| <td>coffey (4 - 1)</td> | |
| <td>14412</td> | |
| <td>78 - 78</td> | |
| <td>9999-09-26</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-27</td> | |
| <td>reds</td> | |
| <td>6 - 2</td> | |
| <td>claussen (10 - 10)</td> | |
| <td>28031</td> | |
| <td>79 - 78</td> | |
| <td>9999-09-27</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-28</td> | |
| <td>reds</td> | |
| <td>4 - 11</td> | |
| <td>capuano (18 - 11)</td> | |
| <td>21181</td> | |
| <td>79 - 79</td> | |
| <td>9999-09-28</td> | |
| </tr> | |
| <tr> | |
| <td>9999-09-29</td> | |
| <td>reds</td> | |
| <td>2 - 0</td> | |
| <td>milton (8 - 15)</td> | |
| <td>13173</td> | |
| <td>80 - 79</td> | |
| <td>9999-09-29</td> | |
| </tr> | |
| </table> | |
| </div> | |
| </div> | |
| <hr> | |
| <div class="step"> | |
| <div class="step-title">Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.</div> | |
| <div id="step-2" class="content"> | |
| <table> | |
| <tr> | |
| <td>date</td> | |
| <td>opponent</td> | |
| <td>score</td> | |
| <td>loss</td> | |
| <td>attendance</td> | |
| <td>record</td> | |
| <td>game_date</td> | |
| </tr> | |
| </table> | |
| </div> | |
| </div> | |
| <hr> | |
| <div class="step"> | |
| <div class="step-title">Final output table:</div> | |
| <div id="step-3" class="content"> | |
| <table> | |
| <tr> | |
| <td>verification_result</td> | |
| </tr> | |
| <tr> | |
| <td>FALSE</td> | |
| </tr> | |
| </table> | |
| </div> | |
| </div> | |
| <hr> | |
| <div class="step"><h3><span class="false">Prediction: FALSE </span></h3> | |
| <h3>Ground-truth:</span> TRUE</h3></div> | |
| </body></html> | |