Tutorials
Help
 FAQ
 Object Browser
 Glossary
 About SkyServer
 EDR background
 How To
 - Search
 - Graph
 Download
Searching
 1. Introduction
 2. A Simple Query
 Practice
 3. Common Searches
 4. More Samples
 Practice
 5. Multiple Tables
 Practice
 6. Aggregate Fcns.
 7. Group By
 8. Order By
 Practice
 9. Views
 10. Functions
 Practice
 11. Conclusion

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 the area of the sky near ra = 200, dec = 0?

Modify the previous query so it will return ra and dec of objects where the ra is between 199 and 201 and the dec is between -1 and 1.

Practice 2. Which of the objects you found in Practice 1 are stars?

Open the Object Browser. Click on tables and select PhotoObj. You will see a list of all the columns in the PhotoObj table. If you click on the Link to PhotoType symbol, you will see the various values that column may have. For instance, the "type" column may contain star, galaxy, cosmic ray, etc. Modify your query so that it returns the ra, dec, and object id for stars (and only stars) whose ra is between 199 and 201 and whose dec is between -1 and 1.

Answers


Format HTML XML CSV

Enter your SQL query in the text box. The query is limited to 90 seconds and 1,000 rows.
The query you just submitted may take up to 90 seconds. Please wait until it finishes...