Database.What is a “relational data model”?

The relational data model is a way to organize data in a database using tables (also called relations). It was introduced by E. F. Codd in 1970 and is the foundation of relational databases like MySQL, PostgreSQL, and Oracle.


🧱 Key Concepts:

  1. Relation (Table)
    • A set of rows and columns.
    • Each table represents a type of entity (e.g., Users, Orders).
  2. Tuple (Row)
    • A single record in a table.
    • Represents one instance of the entity.
  3. Attribute (Column)
    • A field or property of the entity (e.g., Name, Email).
    • Each column has a data type (e.g., INTEGER, VARCHAR).
  4. Primary Key
    • A column (or group of columns) that uniquely identifies each row in a table.
  5. Foreign Key
    • A column that links to the primary key of another table, establishing a relationship.

📊 Example: Two Related Tables

Customers

CustomerID (PK)NameEmail
1Alicealice@mail.com
2Bobbob@mail.com

Orders

OrderID (PK)CustomerID (FK)Product
1011Laptop
1022Smartphone

In this example:

  • CustomerID in Customers is the primary key.
  • CustomerID in Orders is a foreign key linking to Customers.

✅ Benefits of the Relational Model:

  • Data integrity via keys and constraints
  • Easier querying using SQL
  • Normalization helps reduce data redundancy
  • Strong theoretical foundation
This entry was posted in Без рубрики. Bookmark the permalink.