Re: Academic name for associative array when used to pair column names with data
Date: Wed, 19 Mar 2014 00:46:10 -0700 (PDT)
Message-ID: <356a17de-a755-4922-93c7-3c35ad8a3443_at_googlegroups.com>
On Wednesday, March 19, 2014 3:47:26 AM UTC+1, william.d..._at_gmail.com wrote:
> I read Chris Date's book "An Introduction to Database Systems" where he uses the term "tuple" to describe what is commonly called a "row" in a database. What would the proper term be for an associative array of the column names paired with the data from a particular row (otherwise known as a hash)?
>
>
>
> For example in Perl:
>
>
>
> my _at_column_names = qw/color season sound/;
>
> my _at_data = (
>
> [ qw/blue fall loud/ ],
>
> [ qw/red spring soft/ ],
>
> [ qw/orange winter pin_drop/ ],
>
> );
>
>
>
> foreach my $tuple ( _at_data ) {
>
> my %name_needed
>
> = map { $column_names[$_] => $tuple->[$_] } 0 .. $#column_names;
>
> }
>
>
>
> What would be the proper name for the variable %name_needed? By proper name, I mean something along the lines of "tuple" rather than "hash" or "associative array" .
>
>
>
> Is there a formal name for an associative array when it specifically contains a pairing of column names with data?
>
>
>
> Mathematically it would look something like:
>
>
>
> column_names: { a, b, c, d, e }
>
> data:
>
> {
>
> { 1x1, 1x2, 1x3, 1x4, 1x5 },
>
> { 2x1, 2x2, 2x3, 2x4, 2x5 },
>
> { 3x1, 3x2, 3x3, 3x4, 3x5 },
>
> { 4x1, 4x2, 4x3, 4x4, 4x5 },
>
> { 5x1, 5x2, 5x3, 5x4, 5x5 }
>
> }
>
>
>
> Specifically, what would you call a given pairing of the column names with a tuple from the data, e.g.
>
>
>
> { { a, 2x1 }, { b, 2x2 }, { c, 2x3 }, { d, 2x4 }, { e, 2x5 } }
>
>
>
> Thanks ;-)
The thing that you describe here _IS_ the tuple as contained in the relation.