Sloan Digital Sky Survey SkyServer DR16

SQL Tutorial

# Practice Using Aggregate Functions, Group By, and Order By

Write queries to answer the astronomy questions in Practice 7, 8, and 9. Use the Schema Browser when you need it. Many of these questions can be answered in multiple ways; the Sample Solutions give just one way of solving it.

 Practice 7. What are the northernmost and southernmost objects with spectra measured by the SDSS? Show Sample Solution

 Practice 8. What is the redshift of the nearest galaxy whose spectrum was measured by the SDSS with high confidence (zWarning=0)? Use the equation cz = H0d to find the distance to the galaxy in light-years. The speed of light, c, is 1 light-year per year. The constant H0, called the Hubble constant, is about 70 km/s/Mpc, or 7.11 x 10-11 / yr. Compare the distance you found to the distances to the Andromeda Galaxy (2 million light-years) and the Whirlpool Galaxy (37 million light-years). Does the distance you found seem reasonable? Show Sample Solution

 Practice 9. What field has galaxies with the highest average redshifts in run=5112, camcol=1? Be sure you are searching fields (as run-camcol-field) for galaxies. Also look at how many spectrally measured galaxies are in the field - make sure you don't pick a field with only one or two galaxies! Also, note that this query will probably take a long time to execute. Show Sample Solution

Notice that these practice questions have gotten more difficult, and are more like the questions that astronomers really ask in their research. You're getting better in your searches!

 Format HTML XML CSV

Enter your SQL query in the text box. The query is limited to 10 minutes and 100,000 rows.