|
<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> |
|
<hr/> |
|
<h3><span>Statement:</span> the texas mariners played the tigers two times in the 2008 season</h3> |
|
<h3>Input Table: 2006 texas rangers season</h3> |
|
<div class="step"> |
|
<div class="step"> |
|
<div class="step-title">Step 1: Select rows where 'opponent' is 'tigers'.</div> |
|
<div class="content" id="step-1"> |
|
<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" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>7 - 2</td> |
|
<td>padilla (13 - 9)</td> |
|
<td>23776</td> |
|
<td>69 - 67</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-02</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>6 - 5</td> |
|
<td>volquez (1 - 4)</td> |
|
<td>40222</td> |
|
<td>69 - 68</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-03</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>5 - 2</td> |
|
<td>byrd</td> |
|
<td>19667</td> |
|
<td>70 - 68</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-04</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">athletics</span></td> |
|
<td>8 - 1</td> |
|
<td>zito</td> |
|
<td>23949</td> |
|
<td>71 - 68</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-05</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">athletics</span></td> |
|
<td>5 - 4</td> |
|
<td>saarloos</td> |
|
<td>27225</td> |
|
<td>72 - 68</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-06</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">athletics</span></td> |
|
<td>9 - 6</td> |
|
<td>rupe (0 - 1)</td> |
|
<td>17838</td> |
|
<td>72 - 69</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-08</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>7 - 2</td> |
|
<td>millwood (14 - 10)</td> |
|
<td>28646</td> |
|
<td>72 - 70</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-09</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>3 - 2</td> |
|
<td>rheinecker (4 - 6)</td> |
|
<td>33454</td> |
|
<td>72 - 71</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-10</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>4 - 2</td> |
|
<td>huber</td> |
|
<td>34321</td> |
|
<td>73 - 71</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">9999-09-12</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">tigers</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">3 - 2</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mahay (1 - 3)</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">24196</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">73 - 72</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">9999-09-13</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">tigers</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">11 - 3</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">verlander</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">24672</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">74 - 72</span></td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-14</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>2 - 1</td> |
|
<td>volquez (1 - 5)</td> |
|
<td>21488</td> |
|
<td>74 - 73</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-15</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>2 - 1</td> |
|
<td>francisco (0 - 1)</td> |
|
<td>30788</td> |
|
<td>74 - 74</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-16</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>12 - 6</td> |
|
<td>lackey</td> |
|
<td>40196</td> |
|
<td>75 - 74</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-17</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>8 - 1</td> |
|
<td>santana</td> |
|
<td>24303</td> |
|
<td>76 - 74</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-18</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>8 - 1</td> |
|
<td>hernández</td> |
|
<td>18214</td> |
|
<td>77 - 74</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-19</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>9 - 7</td> |
|
<td>wilson (2 - 3)</td> |
|
<td>18551</td> |
|
<td>77 - 75</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-20</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>6 - 3</td> |
|
<td>tejeda (4 - 4)</td> |
|
<td>26006</td> |
|
<td>77 - 76</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-22</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>12 - 4</td> |
|
<td>byrd</td> |
|
<td>26284</td> |
|
<td>78 - 76</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-23</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>6 - 3</td> |
|
<td>padilla (14 - 10)</td> |
|
<td>38351</td> |
|
<td>78 - 77</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-24</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">indians</span></td> |
|
<td>11 - 6</td> |
|
<td>millwood (16 - 11)</td> |
|
<td>36617</td> |
|
<td>78 - 78</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-25</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>8 - 3</td> |
|
<td>volquez (1 - 6)</td> |
|
<td>39781</td> |
|
<td>78 - 79</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-26</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>5 - 2</td> |
|
<td>escobar</td> |
|
<td>37339</td> |
|
<td>79 - 79</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-27</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">angels</span></td> |
|
<td>6 - 5</td> |
|
<td>wilson (2 - 4)</td> |
|
<td>38032</td> |
|
<td>79 - 80</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-29</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>6 - 5</td> |
|
<td>fruto</td> |
|
<td>30766</td> |
|
<td>80 - 80</td> |
|
</tr> |
|
<tr> |
|
<td>9999-09-30</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>3 - 1</td> |
|
<td>millwood (16 - 12)</td> |
|
<td>23310</td> |
|
<td>80 - 81</td> |
|
</tr> |
|
<tr> |
|
<td>9999-10-01</td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mariners</span></td> |
|
<td>3 - 2</td> |
|
<td>tejeda (5 - 5)</td> |
|
<td>28361</td> |
|
<td>80 - 82</td> |
|
</tr> |
|
</table> |
|
</div> |
|
<hr/> |
|
<div class="step"> |
|
<div class="step-title">Step 2: Use a `CASE` statement to return TRUE if the number of rows is equal to 2, otherwise return FALSE.</div> |
|
<div class="content" id="step-0"> |
|
<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" style="background-color:#90EE90;" title="Used in transformation">9999-09-12</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">tigers</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">3 - 2</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">mahay (1 - 3)</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">24196</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">73 - 72</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">9999-09-13</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">tigers</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">11 - 3</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">verlander</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">24672</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">74 - 72</span></td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr/> |
|
|
|
</div> |
|
</div> |
|
<hr/> |
|
</body></html> |
|
|