|
<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> there were no directors that directed more than one episode</h3> |
|
<h3>Ground-truth:</span> FALSE</h3> |
|
<h3>Input Table: list of republic of doyle episodes</h3> |
|
<div class="step"> |
|
<div class="step"> |
|
<div class="step-title">Step 1: Select rows where 'directed_by' is not null.</div> |
|
<div id="step-1" class="content"> |
|
<table> |
|
<tr> |
|
<td>unnamed__0</td> |
|
<td>title</td> |
|
<td>directed_by</td> |
|
<td>written_by</td> |
|
<td>viewers</td> |
|
<td>original_airdate</td> |
|
<td>prod_code</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">1</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">fathers and sons</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">mike clattenburg</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">allan hawco , perry chafe and malcolm macrury</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">969000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-01-06</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">101</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">the return of the grievous angel</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">steve dimarco</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">allan hawco and avrum jacobson</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">715000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-01-13</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">102</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">3</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">duchess of george</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">mike clattenburg</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">allan hawco , perry chafe and malcolm macrury</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">685000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-01-20</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">103</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">5</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">hit and rum</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">steve dimarco</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">matt maclennan</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">594000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-02-03</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">105</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">6</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">the one who got away</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">larry mclean</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">jesse mckeown</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">1012000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-02-10</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">106</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">7</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">the woman who knew too little</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">robert lieberman</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">jeremy boxen</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">1053000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-03-03</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">107</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">8</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">the tell - tale safe</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">jerry ciccoritti</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">john callaghan and steve cochrane</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">986000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-03-10</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">108</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">9</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">he sleeps with the chips</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">phil earnshaw</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">perry chafe</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">908000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-03-17</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">109</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">10</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">the pen is mightier than the doyle</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">robert lieberman</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">steve cochrane and avrum jacobson</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">897000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-03-24</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">110</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">11</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">a horse divided</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">steve scaini</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">jesse mckeown</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">902000</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">2010-03-31</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:yellow;">111</span></td> |
|
</tr> |
|
</table> |
|
</div> |
|
<hr> |
|
<div class="step"> |
|
<div class="step-title">Step 2: Group the table by 'directed_by' and count the number of unique values in 'directed_by'.</div> |
|
<div id="step-0" class="content"> |
|
<table> |
|
<tr> |
|
<td>unnamed__0</td> |
|
<td>title</td> |
|
<td>directed_by</td> |
|
<td>written_by</td> |
|
<td>viewers</td> |
|
<td>original_airdate</td> |
|
<td>prod_code</td> |
|
</tr> |
|
<tr> |
|
<td>1</td> |
|
<td>fathers and sons</td> |
|
<td>mike clattenburg</td> |
|
<td>allan hawco , perry chafe and malcolm macrury</td> |
|
<td>969000</td> |
|
<td>2010-01-06</td> |
|
<td>101</td> |
|
</tr> |
|
<tr> |
|
<td>2</td> |
|
<td>the return of the grievous angel</td> |
|
<td>steve dimarco</td> |
|
<td>allan hawco and avrum jacobson</td> |
|
<td>715000</td> |
|
<td>2010-01-13</td> |
|
<td>102</td> |
|
</tr> |
|
<tr> |
|
<td>3</td> |
|
<td>duchess of george</td> |
|
<td>mike clattenburg</td> |
|
<td>allan hawco , perry chafe and malcolm macrury</td> |
|
<td>685000</td> |
|
<td>2010-01-20</td> |
|
<td>103</td> |
|
</tr> |
|
<tr> |
|
<td>5</td> |
|
<td>hit and rum</td> |
|
<td>steve dimarco</td> |
|
<td>matt maclennan</td> |
|
<td>594000</td> |
|
<td>2010-02-03</td> |
|
<td>105</td> |
|
</tr> |
|
<tr> |
|
<td>6</td> |
|
<td>the one who got away</td> |
|
<td>larry mclean</td> |
|
<td>jesse mckeown</td> |
|
<td>1012000</td> |
|
<td>2010-02-10</td> |
|
<td>106</td> |
|
</tr> |
|
<tr> |
|
<td>7</td> |
|
<td>the woman who knew too little</td> |
|
<td>robert lieberman</td> |
|
<td>jeremy boxen</td> |
|
<td>1053000</td> |
|
<td>2010-03-03</td> |
|
<td>107</td> |
|
</tr> |
|
<tr> |
|
<td>8</td> |
|
<td>the tell - tale safe</td> |
|
<td>jerry ciccoritti</td> |
|
<td>john callaghan and steve cochrane</td> |
|
<td>986000</td> |
|
<td>2010-03-10</td> |
|
<td>108</td> |
|
</tr> |
|
<tr> |
|
<td>9</td> |
|
<td>he sleeps with the chips</td> |
|
<td>phil earnshaw</td> |
|
<td>perry chafe</td> |
|
<td>908000</td> |
|
<td>2010-03-17</td> |
|
<td>109</td> |
|
</tr> |
|
<tr> |
|
<td>10</td> |
|
<td>the pen is mightier than the doyle</td> |
|
<td>robert lieberman</td> |
|
<td>steve cochrane and avrum jacobson</td> |
|
<td>897000</td> |
|
<td>2010-03-24</td> |
|
<td>110</td> |
|
</tr> |
|
<tr> |
|
<td>11</td> |
|
<td>a horse divided</td> |
|
<td>steve scaini</td> |
|
<td>jesse mckeown</td> |
|
<td>902000</td> |
|
<td>2010-03-31</td> |
|
<td>111</td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr> |
|
<div class="step"> |
|
<div class="step-title">Step 3: Use a `CASE` statement to return TRUE if the number of unique values is equal to the number of rows, otherwise return FALSE.</div> |
|
<div id="step-1" class="content"> |
|
<table> |
|
<tr> |
|
<td>directed_by</td> |
|
<td>unique_directors</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">jerry ciccoritti</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">larry mclean</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">mike clattenburg</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">phil earnshaw</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">robert lieberman</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">steve dimarco</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">steve scaini</span></td> |
|
<td><span class="highlighted-cell" title="Used in transformation" style="background-color:#90EE90;">1</span></td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr> |
|
<div class="step"> |
|
<div class="step-title">Final output table:</div> |
|
<div id="step-2" class="content"> |
|
<table> |
|
<tr> |
|
<td>verification_result</td> |
|
</tr> |
|
<tr> |
|
<td>TRUE</td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr> |
|
<div class="step"><h3><span class="false">Prediction: TRUE </span></h3> |
|
<h3>Ground-truth:</span> FALSE</h3></div> |
|
</body></html> |
|
|