The Relational Model

  • Tiene ~35 años
  • fundamento de las bases de datos, y subyace en la mayoria de bases dedatos comerciales
  • Es un modelo muy sencillo y extremadamente expresivo para realizar preguntas a ala base de datos.
  • Existe eficientes implementaciones del modelo relacional.

Construciones básicas del modelo relacional

Important

Database = set of named relations (or tables)

relation

Una base de datos esta contituido por un conjunto de relaciones (relations) referidos como “tablas” (tables), los cuales tienen un nombre

Por ejemplo la tabla Student (en singular):

Student
+------+-------+--------+--------+
|      |       |        |        |
+======+=======+========+========+
|      |       |        |        |
+------+-------+--------+--------+
|      |       |        |        |
+------+-------+--------+--------+
        ...
+------+-------+--------+--------+
|      |       |        |        |
+------+-------+--------+--------+

Important

Each relation has a set of named attributes (or columns)

attributes

Ejemplo en la tabla Student, agregamos los atributos: ID, name, GPA, Photo:

Student
+------+-------+--------+--------+
| ID   | name  | GPA    | Photo  |
+======+=======+========+========+
|      |       |        |        |
+------+-------+--------+--------+
|      |       |        |        |
+------+-------+--------+--------+
        ...
+------+-------+--------+--------+
|      |       |        |        |
+------+-------+--------+--------+

Important

Each tuple (or row) has a value for each attribute.

tuple

Por ejemplo en nuestra tabla Students:

Student
+------+-------+--------+--------+
| ID   | name  | GPA    | Photo  |
+======+=======+========+========+
| 123  | Amy   | 3.9    | (^_^)  |
+------+-------+--------+--------+
| 234  | Bob   | 3.4    | (T_T)  |
+------+-------+--------+--------+
        ...
+------+-------+--------+--------+
|      |       |        |        |
+------+-------+--------+--------+

Important

Each attribute has a type (domain)

type

Por ejemplo en nuestra table Student:

ID     --> integer
name   --> string
GPA    --> float
photo  --> jpeg file

Table Of Contents

Previous topic

Introducción

Next topic

Querying Relational databases