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

Views

Look again at the left column of the Object Browser. You already know what a table is - a storehouse for data of the same type. But what about those other terms?

A view is a virtual table created by combining records from real tables. The records that make up a view remain in their original tables, but they can be accessed and searched through the view.

What does this mean for you? If you're a database programmer, the difference is crucial. For the rest of you, the difference is... nothing. For the purpose of searching for data, a view is a table, and a table is a view. You can search views just like tables, by listing them in the from block.

In fact, many of the so-called "tables" you have been using are actually views! The specObj "table" is actually a view created from the specObjAll table, which contains both good and bad spectra. The PhotoPrimary, Star, Galaxy, and Unknown databases are all views created from the PhotoObj table. You've been using these views all along!

Try searching the same area of sky using the SpecObjAll table and the SpecObj view, or the PhotoObj table and Star, Galaxy, or Unknown views. What differences do you see?

When you are ready to move on, click Next to learn about functions.


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...