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?
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?
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 .