SDSS SkyServer
DR7 Home
This is the DR7 Catalog Archive Server providing public access to SDSS DR7 data for professional astronomers.
The following databases are available
BESTDR7Default, the best Photo, Spectro and Tiling data
TARGDR7Photo, frozen at time of target selection
BESTDR6The Best data version for the previous release.
StetsonSDSS matches to Stetson dataset.
RC3SDSS matches to RC3 catalog.

Quick Guide

To run a query on one of the DR7 DBs other than BESTDR7, name the database
explicitely in the query, like

SELECT TOP 100 * FROM TARGDR7..PhotoObj WHERE r<17 and r-i>2

  • If there is no dbname used, the query will default to the BESTDR7 database


You can submit queries with the SDSS Query Analyzer (sdssQA) Java application, which can be downloaded here, and contains 25 sample queries.

You can run queries on this skyserver directly using Robert Lupton's emacs interface at: (download) . There are also sample queries on this site in the examples.sql file.

You can also run command-line queries on the DR7 databases using Tamas Budavari's Python tool sqlcl at the sqlcl download page.

Note that both the emacs interface and sqlcl submit queries via the skyServer, so they are subject to the same execution time and row limits as this page. The sdssQA is the only interface that goes directly to the databases (using ODBC), so it is not subject to the same restrictions as the SkyServer.

You can link to the SQL search page directly via a URL:,
which takes two parameters:

cmdThe body of the SQL command, with URL-encoding
formatHTML: as a normal web output in tabular form
XML: as an xml document
CSV: as a comma separated ASCII values with a header line


If you wanted to run the following query : SELECT TOP 20 * FROM Galaxy WHERE r<17, and get back the result as a csv file, then you would run the following command line process:

wget -q -O "out.csv" "

Feb 2, 2004 Ani Thakar, JHU