Skip to article frontmatterSkip to article content

Using Databases Introduction

Max Planck Institute for Astronomy, Königstuhl 17, 69117 Heidelberg, Germany

What is a database?

A database is a collection of data organized and stored in a computer system so it can be accessed and updated efficiently.

There are a number of ways to organize the data and so there are a number of different ~types~ of databases.

What is in a database?

A database typically consists of the following components:

Types of databases

Databases are sometimes referred to as Database Management Systems or DBMS, which is really the whole package of data and code but I am using “databases” for short.

There are many different types of databases. Some examples inclide: relational, object-oriented, graph-based, key-value and NoSQL. In same cases you may also see object, graph, key-value, etc. databases being classified as NoSQL and NoSQL databases may have SQL-like interfaces.

Current market share by DBMS: Relational database#Market share as of January 2023.

And now: https://db-engines.com/en/ranking

Why use a database and not a FITS table or a big file?

Disadvantages

There are also some disadvantages to using database architecture:

(List courtesy of Andrey https://stackoverflow.com/questions/2356851/database-vs-flat-files)

Databases in Astronomy

There are lots of databases in astronomy. May of them have web interfaces. What are some databases that you use frequently?

Webpages are nice but reproducible they are not. In order to address this, may

Astroquery: https://astroquery.readthedocs.io/en/latest/

Notes from BG workshop: Archives/archive_exploration.ipynb

Go over archive, SDSS, HST and JWST. Finish with astrometry.net.

SQL

Even if you live well, you have to at some point write a SQL query.

SQL cheat sheet: https://learnsql.com/blog/sql-basics-cheat-sheet/sql-basics-cheat-sheet-a4.pdf

Screen Shot 2023-12-08 at 12 25 58

ADQL: Screen Shot 2023-12-08 at 12 27 52

Foundations of astronomical data science:

https://datacarpentry.org/astronomy-python/

Full presentation: https://prezi.com/view/dCnsaMtMYwgf6NdMkGSX/