This page allows you to directly submit a SQL (Structured Query Language)
query to the SDSS database server. You can modify the default query as you wish, or cut and paste a query from the SDSS Sample Queries page.
To be fair to other users, queries run from SkyServer search
tools are restricted in how long they can run and how much output they
return, by timeouts and row limits. Please see the Query Limits help page.
To run a query that is not restricted by a timeout or number of rows returned, please use the CasJobs batch query service.
To find out more about the database schema use the Schema Browser.
For an introduction to the Structured Query Language (SQL), please see
SQL Intro help page.
please read the Optimizing Queries