Sloan Digital Sky Survey SkyServer DR15
Not logged in Login Help
 Home Data Schema Education Astronomy SDSS Contact Us Download Site Search Help History NEW!

SQL Tutorial

# Writing Simple Queries

Now it's your turn to write some SQL queries! The query window below contains the sample query from the last page. Modify it to answer the questions in Practice 1 and Practice 2 below.

 Practice 1. What objects has the SDSS seen in a smaller area of the sky near ra = 140.5, dec = 20.5 (the same area you searched in the previous query)? Modify the previous query so it will return ra and dec of objects where the ra is between 140.25 and 140.75 and the dec is between 20.25 and 20.75. About how many objects did the query return? Does this seem to make sense, given the smaller area you searched here? Show Sample Solution

 Practice 2. Which of the objects you found in Practice 1 are galaxies? Open the Schema Browser . Click on views and select SpecObj. You will see a list of all the columns in the SpecObj table, along with short descriptions of what they mean and if applicable, what values the column may have. For instance, if you scroll down to the "class" column, its description says that it may have one of the following values: 'STAR', 'GALAXY', or 'QSO'. Modify your query so that it returns the ra, dec, and best object ID for galaxies (and only galaxies) whose ra is between 140.25 and 140.75 and whose dec is between 20.25 and 20.75. Show Sample Solution