Database fundamentals

Relational Databases

Relational databases are the software that implements the ideas from the relational model, storing data in tables you query with SQL.

Relational databases are the software that puts the Relational Model into practice.

In a relational database, data lives in tables. Think of a spreadsheet where each sheet is one table and each row is one record.

Each table contains one or more columns. Each column holds values of a specific type, like strings, numbers, and dates. The type tells the database what operations and comparisons are valid.

The set of a table and all the rules about its columns is called a schema. The schema is the contract your application and migrations rely on.

Each table can define constraints on the data each row can contain. Constraints reject bad data at write time instead of letting it spread through reports.

Tables can reference each other and form relationships using foreign keys. A foreign key stores another table’s primary key value and keeps the link honest.

A Database Management System is the software that implements the database on a computer system. PostgreSQL, MySQL, and SQLite are all DBMS products you can install and run today.

Relational databases commonly use the SQL language so you can create a database, define table schemas, fill tables with data, and query the data when you need it. The same language works across most relational products.

Some examples of software that implements relational databases are PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server.

If you are trying to pick between the most popular ones, I built a free Postgres vs SQLite vs MySQL comparison tool that shows their differences side by side.

Lesson completed