SQL: Structured Query Language

Locating Objects in a Database

When astronomers want to find an object in the sky with a telescope, they can simply look through the eyepiece and scan around, or if they know where the object is relative to a brighter object, they can star hop to the location. With the help of some additional technology on their telescopes, they can use the RA and Dec coordinates of the object to point to a precise location. But what do astronomers do when the images (and all the measurements that have been taken using those images) are stored in a computer database? For this task, we need a way to talk to the database and ask it to search for and return the information we need. This is the job of SQL or structured query language.
Decisions about how to design a database are very important. Before the Sloan Digital Sky Survey began capturing light from distant stars and galaxies in 1998, software engineers had to make decisions about how the data from the survey would be organized. They organized the SDSS database into tables, each of which contains columns of related information. An SQL query is a set of instructions that accesses this information. Let’s look at an example.

What can an SQL query do?

The query we have used here is very simple, but others can be more complex. Queries may pertain to a more specific location or size of the area in the sky. The kind of information that you want returned is based on your search preferences; you can even request that the data be sorted in some way before being returned to you. Writing SQL queries is a skill that you build with practice. If you would like to simply learn SQL on its own, the SkyServer website hosts an SQL tutorial. while doing other Launch and Expedition activities, such as The Hubble Tuning Fork Diagram in Color.