Tuples in database

4

I know what a tuple is in Python but not in a database, so the question follows:

What is a tuple in the database context?

    
asked by anonymous 08.11.2016 / 16:27

1 answer

3

Tuplet is a vessel (literal translation) where it puts a lot of things. We roughly refer to it as the line of the table, or the record, as the concept is also known. But let's be more specific.

By the mathematical definition it is an orderly and finite sequence of elements. Each element has a name identifier and a value.

So in the database you are joining the data needed to fill in what the table expects in just one conceptual unit.

At the moment of INSERT we see the tuple very clearly. Example:

INSERT (id, nome, idade, salario) VALUES (1, "joão", 25, 1000.00);

Here we have a tuple consisting of the names (id, nome, idade, salario) and the (1, "joão", 25, 1000.00) values, just as you are accustomed in Python and other languages.

Note that without names it is not a tuple, it is just a line, although it is common for people to use the term interchangeably.

Related .

    
08.11.2016 / 16:42