...

/

Relational Databases

Relational Databases

Learn about relational databases, their structure, and indexes.

Whenever an application needs a long-term data store, our default choice is a database. A relational database is an old and reliable way to store arbitrary data in computer systems.

Relational databases are storage for structured data. They consist of multiple tables, and each table contains multiple records sharing the same set of attributes.

For example, imagine the information we can store about a theater play. It could be the name, author, duration, and a description. We can also add an ID to distinguish it. Each play has a different name, but it always has one. The same goes for the author and description. The plays have different data but a common set of properties.

We can put all the information into a table in which each row is a separate play, and each column is one thing we can know about every play, like the name or author. We can save such a structure in an Excel table, a CSV file, or a database. Relational databases store data that look like tables.

Such databases are relational, because, in relational database theory, tables are called relations. This term is rarely used with its original meaning now.

This chapter is an introduction to relational databases. The topic is big enough for a separate course, so it’s more like a tour of the features of relational databases.

Relational database structure

Usually, the application ...