|
<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> at 459 feet , the schiesinger building is the fourth largest building in johannesburg</h3> |
|
<h3>Input Table: list of tallest buildings in africa</h3> |
|
<div class="step"> |
|
<div class="step"> |
|
<div class="step-title">Step 1: Order the table by 'feet' in descending order.</div> |
|
<div class="content" id="step-1"> |
|
<table> |
|
<tr> |
|
<td>name</td> |
|
<td>city</td> |
|
<td>years_as_tallest</td> |
|
<td>metres</td> |
|
<td>feet</td> |
|
<td>floors</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">carlton centre</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1973-01-01 - present</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">223.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">732</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">50</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">kwadukuza egoli hotel tower 1 , trust bank building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1970-01-01 - 1973-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">140.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">459</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">31</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">standard bank building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1968-01-01 - 1970-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">138.8</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">455</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">34</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">schlesinger building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">9999-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">110.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">361</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">21</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">naspers centre</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">cape town</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">9999-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">93.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">205</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">22</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">mutual heights building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">cape town</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1940-01-01 - 1962-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">91.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">298</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">18</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">chamber of mines building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1936-01-01 - 1940-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">80.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">262</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">18</span></td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">union buildings</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">pretoria</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">1913-01-01 - 1936-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">60.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">196</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">10</span></td> |
|
</tr> |
|
</table> |
|
</div> |
|
<hr/> |
|
<div class="step"> |
|
<div class="step-title">Step 2: Select row number 4.</div> |
|
<div class="content" id="step-0"> |
|
<table> |
|
<tr> |
|
<td>name</td> |
|
<td>city</td> |
|
<td>years_as_tallest</td> |
|
<td>metres</td> |
|
<td>feet</td> |
|
<td>floors</td> |
|
</tr> |
|
<tr> |
|
<td>carlton centre</td> |
|
<td>johannesburg</td> |
|
<td>1973-01-01 - present</td> |
|
<td>223.0</td> |
|
<td>732</td> |
|
<td>50</td> |
|
</tr> |
|
<tr> |
|
<td>kwadukuza egoli hotel tower 1 , trust bank building</td> |
|
<td>johannesburg</td> |
|
<td>1970-01-01 - 1973-01-01</td> |
|
<td>140.0</td> |
|
<td>459</td> |
|
<td>31</td> |
|
</tr> |
|
<tr> |
|
<td>standard bank building</td> |
|
<td>johannesburg</td> |
|
<td>1968-01-01 - 1970-01-01</td> |
|
<td>138.8</td> |
|
<td>455</td> |
|
<td>34</td> |
|
</tr> |
|
<tr> |
|
<td>schlesinger building</td> |
|
<td>johannesburg</td> |
|
<td>9999-01-01</td> |
|
<td>110.0</td> |
|
<td>361</td> |
|
<td>21</td> |
|
</tr> |
|
<tr> |
|
<td>mutual heights building</td> |
|
<td>cape town</td> |
|
<td>1940-01-01 - 1962-01-01</td> |
|
<td>91.0</td> |
|
<td>298</td> |
|
<td>18</td> |
|
</tr> |
|
<tr> |
|
<td>chamber of mines building</td> |
|
<td>johannesburg</td> |
|
<td>1936-01-01 - 1940-01-01</td> |
|
<td>80.0</td> |
|
<td>262</td> |
|
<td>18</td> |
|
</tr> |
|
<tr> |
|
<td>naspers centre</td> |
|
<td>cape town</td> |
|
<td>9999-01-01</td> |
|
<td>93.0</td> |
|
<td>205</td> |
|
<td>22</td> |
|
</tr> |
|
<tr> |
|
<td>union buildings</td> |
|
<td>pretoria</td> |
|
<td>1913-01-01 - 1936-01-01</td> |
|
<td>60.0</td> |
|
<td>196</td> |
|
<td>10</td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr/> |
|
<div class="step"> |
|
<div class="step-title">Step 3: Select rows where 'name' is 'schlesinger building' and 'city' is 'johannesburg'.</div> |
|
<div class="content" id="step-1"> |
|
<table> |
|
<tr> |
|
<td>name</td> |
|
<td>city</td> |
|
<td>years_as_tallest</td> |
|
<td>metres</td> |
|
<td>feet</td> |
|
<td>floors</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">schlesinger building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">9999-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">110.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">361</span></td> |
|
<td><span class="highlighted-cell" style="background-color:yellow;" title="Used in transformation">21</span></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 class="content" id="step-2"> |
|
<table> |
|
<tr> |
|
<td>name</td> |
|
<td>city</td> |
|
<td>years_as_tallest</td> |
|
<td>metres</td> |
|
<td>feet</td> |
|
<td>floors</td> |
|
</tr> |
|
<tr> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">schlesinger building</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">johannesburg</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">9999-01-01</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">110.0</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">361</span></td> |
|
<td><span class="highlighted-cell" style="background-color:#90EE90;" title="Used in transformation">21</span></td> |
|
</tr> |
|
</table> |
|
</div> |
|
</div> |
|
<hr/> |
|
|
|
</div> |
|
</div> |
|
<hr/> |
|
</body></html> |
|
|