🏷️ Essential concepts: table, record, and field
To understand how relational databases work, it is fundamental to understand these concepts:
Table
- It is a structure that organizes data into rows and columns.
- Each table stores information about a specific topic or entity (for example: Users, Products, Sales).
- A database can have many tables, each with a different purpose.
Example:
| user_id | name | registration_date | |
|---|---|---|---|
| 1 | Ana | ana@mail.com | 2023-01-01 |
| 2 | Juan | juan@mail.com | 2023-02-10 |
Record (Row)
- A record is a row in a table.
- It represents an individual unit of information, that is, a single object or person.
- Each record has a value directly related to the field.
Example:
- The record
[2, Juan, juan@mail.com, 2023-02-10]corresponds to a specific user.
Field (Column)
- A field is a column in the table.
- It defines the type of information stored in that space for all records (for example: name, email, date).
- Each field has a name and a data type.
Example:
- In the previous table, the fields are:
user_id,name,email,registration_date.
Visual Summary
| id | name | age | |
|---|---|---|---|
| 1 | Ana | ana@mail.com | 25 |
| 2 | Juan | juan@mail.com | 30 |
- Table: Users
- Fields: id, name, email, age
- Record: [2, Juan, juan@mail.com, 30]
Note
Relational databases are based on organizing data into tables, where each row is a record and each column is a field. This allows storing and relating information in an orderly and efficient manner.