Step 1: Select rows where 'object_type' is 'globular cluster' or 'irregular galaxy'.
ngc_number |
object_type |
constellation |
right_ascension___j2000 |
declination___j2000 |
apparent_magnitude |
5408 |
irregular galaxy |
centaurus |
14h03 m21.0s |
degree22′44″ |
14.0 |
5457 |
spiral galaxy |
ursa major |
14h03 m12.5s |
degree20′53″ |
8.7 |
5466 |
globular cluster |
boötes |
14h05 m27.4s |
degree32′04″ |
10.5 |
5474 |
spiral galaxy |
ursa major |
14h05 m01.5s |
degree39′45″ |
11.9 |
5477 |
irregular galaxy |
ursa major |
14h05 m33.1s |
degree27′40″ |
14.5 |
Step 2: Cast to FLOAT and order the table by 'apparent_magnitude' in ascending order and select the first row.
ngc_number |
object_type |
constellation |
right_ascension___j2000 |
declination___j2000 |
apparent_magnitude |
5408 |
irregular galaxy |
centaurus |
14h03 m21.0s |
degree22′44″ |
14.0 |
5466 |
globular cluster |
boötes |
14h05 m27.4s |
degree32′04″ |
10.5 |
5477 |
irregular galaxy |
ursa major |
14h05 m33.1s |
degree27′40″ |
14.5 |
Step 3: Select rows where 'object_type' is 'globular cluster'.
ngc_number |
object_type |
constellation |
right_ascension___j2000 |
declination___j2000 |
apparent_magnitude |
5466 |
globular cluster |
boötes |
14h05 m27.4s |
degree32′04″ |
10.5 |
Step 4: Use a `CASE` statement to return TRUE if the number of rows is equal to 1, otherwise return FALSE.
ngc_number |
object_type |
constellation |
right_ascension___j2000 |
declination___j2000 |
apparent_magnitude |
5466 |
globular cluster |
boötes |
14h05 m27.4s |
degree32′04″ |
10.5 |
Prediction: TRUE