Loading...

Relations and Databases

ReachabilityRelation Algebra

One of the most important types of modern databases is the relational database. Their foundation is directly the mathematical concept of relations, which describe connections between sets. In databases, relations are represented in the form of tables.

The Relational Model

A relational database consists of tables, where each table represents a relation. The rows represent individual records (ordered n-tuples), and the columns represent attributes (fields).

  • The rows of a table = the elements of the relation.
  • The columns of a table = attributes (e.g., name, age).
  • Keys ensure unique identification.
  • Connections between tables implement relations.

Example of a Relational Table

Suppose there is a STUDENTS table with the following columns: (Name, StudentID, Major).

For example:

  • Anna | S123 | Computer Science
  • Béla | S456 | Mathematics

Here, the StudentID serves as the primary key to uniquely identify each student.

Connections Between Tables

In a real database, multiple tables are connected via keys. For example, a REGISTRATION table that specifies which student is enrolled in which course.

  • STUDENTS(Name, StudentID, Major)
  • COURSES(CourseID, Subject)
  • REGISTRATION(StudentID, CourseID)

The REGISTRATION table is thus a relation that connects the STUDENTS and COURSES sets.

Properties

  • The relational model is based on the mathematical concept of relations.
  • Every table represents a relation.
  • Connections between relations can be one-to-one, one-to-many, or many-to-many.
  • SQL (Structured Query Language) is used to manage and query relations.

Summary

In the world of databases, relations play a fundamental role. Every table represents a relation, and connections between tables form additional relations. This mathematical foundation ensures the logical and reliable operation of data management.

Practice Exercise

We have reviewed and checked the materials, but errors may still occur. The content is provided for educational purposes only, so use it at your own responsibility and verify with other sources if needed.

✨ Ask Lara

Please sign in to ask Lara about Relations and Databases.

Track Your Progress 🚀

Learn more easily by tracking your progress completely for free.


Top tools

CodeHubBoardly NEWLinksy NEWChromo NEW

Select Language

Set theme

© 2025 ReadyTools. All rights reserved.