dbTalk Databases Forums  

Foreign keys

comp.databases.theory comp.databases.theory


Discuss Foreign keys in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #101  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 12:11 AM







"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote

Quote:
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011514331750073-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 14:16:32 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011512561916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 11:51:43 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011510320716807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 04:37:23 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011502240916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evankeel (AT) sbcglobal (DOT) net
said:

[...]
What if
both the determinant and the dependent draw their values from the same
domain? For example, EmployeeId --> ManagerId, since managers are also
employees.

What about it? How does that require surjectivity on the domain of
PartNo?

Conceivably, the domain of PartNo would include all possible integers.
But the relation will not necessarily have all tuples where *every*
possible values of PartNo are in some tuple of the relation.


I think you're confusing what is possible and what is actual. What is
represented by the domains and the intension of a database specifies
/what
can be/, but due to the domain closure assumption, what is represented by
values in the extension of a database states /what is/. A functional
dependency does not limit the possible values in each domain: it instead
controls which combinations of values are possible. Lets take that one
step
further, a functional dependency A --> B does not directly limit the
possible values for A or for B; instead it limits the possible
combinations
of values for A and B.

So, a functional dependency does not limit the possible values in each
domain. Ok.

Rather, it limits the possible combinations of A x B. Ok.

Since A --> B only limits AB combinations, then for
each value for B there must be at least one value for A, otherwise there
wouldn't be an AB combination, would there?

I still don't see the surjectivity requirement.

In mathematics, a function is not necessarily surjective. For example,
let R be the set of real numbers. Then the function
f : R --> R
defined by
f(x) = x^2
is not a surjective function because f(x) can never be a negative number.

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.

The functional dependency does not affect the set of all possible values for
Age; it controls the possible combinations of values for Name and Age. If
there is only one tuple with Name 'Brian' in the database, then the
functional dependency would hold no matter what the value for Age is. The
dependency holds, or is satisfied, so long as there aren't two tuples with
the same Name but different Ages.


Quote:
Are you saying that Name --> Age is not a functional dependency because it
is not surjective?

No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.

Quote:
--

-kira




Reply With Quote
  #102  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 12:11 AM







"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote

Quote:
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011514331750073-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 14:16:32 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011512561916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 11:51:43 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011510320716807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 04:37:23 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011502240916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evankeel (AT) sbcglobal (DOT) net
said:

[...]
What if
both the determinant and the dependent draw their values from the same
domain? For example, EmployeeId --> ManagerId, since managers are also
employees.

What about it? How does that require surjectivity on the domain of
PartNo?

Conceivably, the domain of PartNo would include all possible integers.
But the relation will not necessarily have all tuples where *every*
possible values of PartNo are in some tuple of the relation.


I think you're confusing what is possible and what is actual. What is
represented by the domains and the intension of a database specifies
/what
can be/, but due to the domain closure assumption, what is represented by
values in the extension of a database states /what is/. A functional
dependency does not limit the possible values in each domain: it instead
controls which combinations of values are possible. Lets take that one
step
further, a functional dependency A --> B does not directly limit the
possible values for A or for B; instead it limits the possible
combinations
of values for A and B.

So, a functional dependency does not limit the possible values in each
domain. Ok.

Rather, it limits the possible combinations of A x B. Ok.

Since A --> B only limits AB combinations, then for
each value for B there must be at least one value for A, otherwise there
wouldn't be an AB combination, would there?

I still don't see the surjectivity requirement.

In mathematics, a function is not necessarily surjective. For example,
let R be the set of real numbers. Then the function
f : R --> R
defined by
f(x) = x^2
is not a surjective function because f(x) can never be a negative number.

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.

The functional dependency does not affect the set of all possible values for
Age; it controls the possible combinations of values for Name and Age. If
there is only one tuple with Name 'Brian' in the database, then the
functional dependency would hold no matter what the value for Age is. The
dependency holds, or is satisfied, so long as there aren't two tuples with
the same Name but different Ages.


Quote:
Are you saying that Name --> Age is not a functional dependency because it
is not surjective?

No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.

Quote:
--

-kira




Reply With Quote
  #103  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 12:11 AM




"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote

Quote:
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011514331750073-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 14:16:32 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011512561916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 11:51:43 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011510320716807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 04:37:23 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011502240916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evankeel (AT) sbcglobal (DOT) net
said:

[...]
What if
both the determinant and the dependent draw their values from the same
domain? For example, EmployeeId --> ManagerId, since managers are also
employees.

What about it? How does that require surjectivity on the domain of
PartNo?

Conceivably, the domain of PartNo would include all possible integers.
But the relation will not necessarily have all tuples where *every*
possible values of PartNo are in some tuple of the relation.


I think you're confusing what is possible and what is actual. What is
represented by the domains and the intension of a database specifies
/what
can be/, but due to the domain closure assumption, what is represented by
values in the extension of a database states /what is/. A functional
dependency does not limit the possible values in each domain: it instead
controls which combinations of values are possible. Lets take that one
step
further, a functional dependency A --> B does not directly limit the
possible values for A or for B; instead it limits the possible
combinations
of values for A and B.

So, a functional dependency does not limit the possible values in each
domain. Ok.

Rather, it limits the possible combinations of A x B. Ok.

Since A --> B only limits AB combinations, then for
each value for B there must be at least one value for A, otherwise there
wouldn't be an AB combination, would there?

I still don't see the surjectivity requirement.

In mathematics, a function is not necessarily surjective. For example,
let R be the set of real numbers. Then the function
f : R --> R
defined by
f(x) = x^2
is not a surjective function because f(x) can never be a negative number.

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.

The functional dependency does not affect the set of all possible values for
Age; it controls the possible combinations of values for Name and Age. If
there is only one tuple with Name 'Brian' in the database, then the
functional dependency would hold no matter what the value for Age is. The
dependency holds, or is satisfied, so long as there aren't two tuples with
the same Name but different Ages.


Quote:
Are you saying that Name --> Age is not a functional dependency because it
is not surjective?

No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.

Quote:
--

-kira




Reply With Quote
  #104  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 12:11 AM




"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote

Quote:
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011514331750073-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 14:16:32 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011512561916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 11:51:43 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011510320716807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 04:37:23 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011502240916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evankeel (AT) sbcglobal (DOT) net
said:

[...]
What if
both the determinant and the dependent draw their values from the same
domain? For example, EmployeeId --> ManagerId, since managers are also
employees.

What about it? How does that require surjectivity on the domain of
PartNo?

Conceivably, the domain of PartNo would include all possible integers.
But the relation will not necessarily have all tuples where *every*
possible values of PartNo are in some tuple of the relation.


I think you're confusing what is possible and what is actual. What is
represented by the domains and the intension of a database specifies
/what
can be/, but due to the domain closure assumption, what is represented by
values in the extension of a database states /what is/. A functional
dependency does not limit the possible values in each domain: it instead
controls which combinations of values are possible. Lets take that one
step
further, a functional dependency A --> B does not directly limit the
possible values for A or for B; instead it limits the possible
combinations
of values for A and B.

So, a functional dependency does not limit the possible values in each
domain. Ok.

Rather, it limits the possible combinations of A x B. Ok.

Since A --> B only limits AB combinations, then for
each value for B there must be at least one value for A, otherwise there
wouldn't be an AB combination, would there?

I still don't see the surjectivity requirement.

In mathematics, a function is not necessarily surjective. For example,
let R be the set of real numbers. Then the function
f : R --> R
defined by
f(x) = x^2
is not a surjective function because f(x) can never be a negative number.

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.

The functional dependency does not affect the set of all possible values for
Age; it controls the possible combinations of values for Name and Age. If
there is only one tuple with Name 'Brian' in the database, then the
functional dependency would hold no matter what the value for Age is. The
dependency holds, or is satisfied, so long as there aren't two tuples with
the same Name but different Ages.


Quote:
Are you saying that Name --> Age is not a functional dependency because it
is not surjective?

No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.

Quote:
--

-kira




Reply With Quote
  #105  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 12:11 AM




"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote

Quote:
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011514331750073-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 14:16:32 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011512561916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 11:51:43 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011510320716807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 04:37:23 -0500, "Brian Selzer"
brian (AT) selzer-software (DOT) com
said:


"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011502240916807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evankeel (AT) sbcglobal (DOT) net
said:

[...]
What if
both the determinant and the dependent draw their values from the same
domain? For example, EmployeeId --> ManagerId, since managers are also
employees.

What about it? How does that require surjectivity on the domain of
PartNo?

Conceivably, the domain of PartNo would include all possible integers.
But the relation will not necessarily have all tuples where *every*
possible values of PartNo are in some tuple of the relation.


I think you're confusing what is possible and what is actual. What is
represented by the domains and the intension of a database specifies
/what
can be/, but due to the domain closure assumption, what is represented by
values in the extension of a database states /what is/. A functional
dependency does not limit the possible values in each domain: it instead
controls which combinations of values are possible. Lets take that one
step
further, a functional dependency A --> B does not directly limit the
possible values for A or for B; instead it limits the possible
combinations
of values for A and B.

So, a functional dependency does not limit the possible values in each
domain. Ok.

Rather, it limits the possible combinations of A x B. Ok.

Since A --> B only limits AB combinations, then for
each value for B there must be at least one value for A, otherwise there
wouldn't be an AB combination, would there?

I still don't see the surjectivity requirement.

In mathematics, a function is not necessarily surjective. For example,
let R be the set of real numbers. Then the function
f : R --> R
defined by
f(x) = x^2
is not a surjective function because f(x) can never be a negative number.

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.

The functional dependency does not affect the set of all possible values for
Age; it controls the possible combinations of values for Name and Age. If
there is only one tuple with Name 'Brian' in the database, then the
functional dependency would hold no matter what the value for Age is. The
dependency holds, or is satisfied, so long as there aren't two tuples with
the same Name but different Ages.


Quote:
Are you saying that Name --> Age is not a functional dependency because it
is not surjective?

No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.

Quote:
--

-kira




Reply With Quote
  #106  
Old   
Kira Yamato
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 01:45 AM



On 2008-01-16 01:11:22 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com> said:

Quote:
"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011600092016807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.


[...]

Are you saying that Name --> Age is not a functional dependency because it
is not surjective?


No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.
Ok. I'm beginning to see your point.

So, in the case of a single relation, the surjectivity holds trivially
from the definition of functional dependency.

However, in the case of foreign key where 2 relations are involved, the
foreign key does not necessarily maps to every possible primary key in
the other relation. So, it is possible to not have surjectivity
between attributes across 2 relations.

So, I do have one more question. Why do we want to require functional
dependencies to be surjective? What desirable property of relational
algebra do we lose if we introduct functional dependencies that are not
surjective?

Thanks.

--

-kira



Reply With Quote
  #107  
Old   
Kira Yamato
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 01:45 AM



On 2008-01-16 01:11:22 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com> said:

Quote:
"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011600092016807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.


[...]

Are you saying that Name --> Age is not a functional dependency because it
is not surjective?


No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.
Ok. I'm beginning to see your point.

So, in the case of a single relation, the surjectivity holds trivially
from the definition of functional dependency.

However, in the case of foreign key where 2 relations are involved, the
foreign key does not necessarily maps to every possible primary key in
the other relation. So, it is possible to not have surjectivity
between attributes across 2 relations.

So, I do have one more question. Why do we want to require functional
dependencies to be surjective? What desirable property of relational
algebra do we lose if we introduct functional dependencies that are not
surjective?

Thanks.

--

-kira



Reply With Quote
  #108  
Old   
Kira Yamato
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 01:45 AM



On 2008-01-16 01:11:22 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com> said:

Quote:
"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011600092016807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.


[...]

Are you saying that Name --> Age is not a functional dependency because it
is not surjective?


No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.
Ok. I'm beginning to see your point.

So, in the case of a single relation, the surjectivity holds trivially
from the definition of functional dependency.

However, in the case of foreign key where 2 relations are involved, the
foreign key does not necessarily maps to every possible primary key in
the other relation. So, it is possible to not have surjectivity
between attributes across 2 relations.

So, I do have one more question. Why do we want to require functional
dependencies to be surjective? What desirable property of relational
algebra do we lose if we introduct functional dependencies that are not
surjective?

Thanks.

--

-kira



Reply With Quote
  #109  
Old   
Kira Yamato
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 01:45 AM



On 2008-01-16 01:11:22 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com> said:

Quote:
"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011600092016807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.


[...]

Are you saying that Name --> Age is not a functional dependency because it
is not surjective?


No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.
Ok. I'm beginning to see your point.

So, in the case of a single relation, the surjectivity holds trivially
from the definition of functional dependency.

However, in the case of foreign key where 2 relations are involved, the
foreign key does not necessarily maps to every possible primary key in
the other relation. So, it is possible to not have surjectivity
between attributes across 2 relations.

So, I do have one more question. Why do we want to require functional
dependencies to be surjective? What desirable property of relational
algebra do we lose if we introduct functional dependencies that are not
surjective?

Thanks.

--

-kira



Reply With Quote
  #110  
Old   
Kira Yamato
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 01:45 AM



On 2008-01-16 01:11:22 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com> said:

Quote:
"Kira Yamato" <kirakun (AT) earthlink (DOT) net> wrote in message
news:2008011600092016807-kirakun (AT) earthlinknet (DOT) ..
On 2008-01-15 22:05:24 -0500, "Brian Selzer" <brian (AT) selzer-software (DOT) com
said:

In relational algebra, say I have a relation Person(Name, Age). Then
there is functional dependency
Name --> Age.
Now, the domain for Age can be any non-negative integer. However, the
extensional relation will not have a tuple for every possible value of
Age.


[...]

Are you saying that Name --> Age is not a functional dependency because it
is not surjective?


No. What I'm saying is that not only is it the case that for every Name in
the extension there is one and only one Age, but also that whenever there is
an Age in the extension, there must also be a Name. This is due to the fact
that Name and Age appear in the same relation schema. So in that sense
Name --> Age /is/ surjective.

I keep wanting to mention active domains, and for a database with a single
relation, it would be valid to say that Name --> Age describes a surjection
between the active domain for Name and the active domain for Age, but for
databases with multiple relations, an active domain is the set of all values
from a domain that are in any relation in the database.
Ok. I'm beginning to see your point.

So, in the case of a single relation, the surjectivity holds trivially
from the definition of functional dependency.

However, in the case of foreign key where 2 relations are involved, the
foreign key does not necessarily maps to every possible primary key in
the other relation. So, it is possible to not have surjectivity
between attributes across 2 relations.

So, I do have one more question. Why do we want to require functional
dependencies to be surjective? What desirable property of relational
algebra do we lose if we introduct functional dependencies that are not
surjective?

Thanks.

--

-kira



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.