Character string relation and functional dependencies
From: Tegiri Nenashi <TegiriNenashi_at_gmail.com>
Date: Mon, 3 Dec 2007 11:16:55 -0800 (PST)
Message-ID: <b77d5359-6e0c-4ae8-91f0-29cc28d03d87_at_d21g2000prf.googlegroups.com>
The connection between objects and databases seems to be a recurring theme here on c.d.t, so I'd like to contribute one observation. Consider a Substring relation:
data | fragment
abab | ab
abc | ab
abc | bc
....
data | fragment | from | to | #
abab | ab | 0 | 2 | 0
abab | ab | 2 | 4 | 1
abc | ab | 0 | 2 | 0
abc | bc | 1 | 3 | 0
....
Date: Mon, 3 Dec 2007 11:16:55 -0800 (PST)
Message-ID: <b77d5359-6e0c-4ae8-91f0-29cc28d03d87_at_d21g2000prf.googlegroups.com>
The connection between objects and databases seems to be a recurring theme here on c.d.t, so I'd like to contribute one observation. Consider a Substring relation:
Substring
data | fragment
abab | ab
abc | ab
abc | bc
....
This is pretty unintersting relation until we add more attributes: the "from" and "to" indicating the position of the fragment inside the data, and "#" -- the occurence number. (All numbers are 0-based, intervals boudaries are including-excluding). The example becomes:
Substring
data | fragment | from | to | #
abab | ab | 0 | 2 | 0
abab | ab | 2 | 4 | 1
abc | ab | 0 | 2 | 0
abc | bc | 1 | 3 | 0
....
There are at least 3 functional dependencies:
fragment, from -> to
data, fragment, # -> from
data, from, to -> fragment
Informally these FDs correspond to the length(), instr(), and substr() functions. So instead of talking about the class String with the length(), instr(), and substr() member functions, we can focus on a relation and functional dependencies.... Received on Mon Dec 03 2007 - 20:16:55 CET