Understanding Relational Database Models: Concepts and Operations
Classified in Computers
Written on in English with a size of 3.26 KB
Relational Model: An In-Depth Look
The relational model allows users to obtain information from the database without needing assistance from information management professionals. The data is stored in a way that:
- Users understand it more easily.
- The data is stored as tables.
- Relationships between rows and tables are visible within the data.
Features of Relational Models
- It is important to know that the entries in the table are atomic.
- All entries in any column are of a single type. The table columns are called attributes.
- No two rows in the table are identical.
Structure of Relational Databases
At the conceptual level, the relational database model is represented by a collection of stored relations.
Submodel Data
External schemas of relational sub-models are called relational data, each consisting of one or more scenarios (views) to describe the data required by a given application.
Storage Scheme
At the domestic level, each base table is implemented as a stored file.
Data Sublanguage
A data sublanguage is a data management language for a relational system.
Data Languages and Consultation
In a procedural language, the user gives the system instructions to execute in a sequence of operations to calculate the desired data result.
In a non-procedural language, the user describes the information without giving a specific procedure to obtain that information.
Fundamental Operations
The operations select, project, and rename are considered unary operations and operate on a single table. Other pairs of operations operate on relations, and these binary operations are called binary operations.
The Select Operation
This operation selects tuples (rows) that satisfy a given condition from a table. It is represented by parentheses:
(WHERE table_name condition);
The condition clause after WHERE
may include equality (=
), <
, >
, >=
, <=
.
The Project Operation
This consists of identifying the columns (attributes in the model) that we are interested in knowing. It is represented by brackets. It does not indicate if all the table columns in question are desired.
(WHERE table_name condition) [attribute_name];
The Cartesian Product Operation
This consists of multiplying all tuples of two tables, obtaining a table that, as a result, contains all the columns of both tables. It is specified with the word TIMES
.
table_name TIMES table_name;
The Join Operation
This consists of obtaining the product (multiplication) of all tuples of one table with the other, to subsequently assess which common fields are generating matches, thus creating a new table as a result that has tuples (rows) that comply with the established condition. It is represented with the word JOIN
.
The word JOIN
is placed between the two tables to be multiplied, after which the selection and projection operation is specified.
(table) [attribute] JOIN (table) [attribute];