Notebook --- title: "Basic queries" teaching: 3000 exercises: 0 questions: - "How can we select and download the data we want from the Gaia server?" objectives: - "Compose a basic query in ADQL/SQL." - "Use queries to explore a database and its tables." - "Use queries to download data." - "Develop, test, and debug a query incrementally." keypoints: - "If you can't download an entire dataset (or it's not practical) use queries to select the data you need." - "Read the metadata and the documentation to make sure you understand the tables, their columns, and what they mean." - "Develop queries incrementally: start with something simple, test it, and add a little bit at a time." - "Use ADQL features like `TOP` and `COUNT` to test before you run a query that might return a lot of data." - "If you know your query will return fewer than 3000 rows, you can run it synchronously, which might complete faster (but it doesn't seem to make much difference). If it might return more than 3000 rows, you should run it asynchronously." - "ADQL and SQL are not case-sensitive, so you don't have to capitalize the keywords, but you should." - "ADQL and SQL don't require you to break a query into multiple lines, but you should." --- {% include links.md %}