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
  #121  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 07:42 AM







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

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


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

Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;

if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.

Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.

Quote:
--

-kira




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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM






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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



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

Default Re: Foreign keys - 01-16-2008 , 10:28 AM



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

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


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


Since functional dependencies are surjective, it can be said that

A --> BC IFF A --> B /AND/ A --> C;
This property sounds like what Date, in his book "Introduction to
Database System," defines as Join-dependency.

Quote:
if they weren't, then it could only be said that

A --> BC IFF A --> B /OR/ A --> C.
Or that we can only say that
if A --> B and A --> C, then A --> BC.
However, the converse statement is not necessarily true.

Quote:
Similarly, the relation schema,

R {A, B, C} where A --> BC,

can represent exactly the same information as the pair of relation schemata,

S {A, B} where A --> B, T {A, C} where A --> C,

if and only if the cyclical inclusion dependency,

S[A] = T[A] (mutual foreign keys)

also holds.
Ok. So the property we want with surjectivity is that of equivalence
of representation through joins.

--

-kira



Reply With Quote
  #130  
Old   
Jan Hidders
 
Posts: n/a

Default Re: Foreign keys - 01-16-2008 , 04:37 PM



On 15 jan, 08:24, Kira Yamato <kira... (AT) earthlink (DOT) net> wrote:
Quote:
On 2008-01-14 21:18:57 -0500, "Evan Keel" <evank... (AT) sbcglobal (DOT) net> said:

Always a physical issue. Never a theory issue.Agree?

Foreign keys are functional dependencies across two relations.

More specifically, let
* * * * R1(K1, A1, B1)
be a relation with attribute sets K1, A1 and B1 where K1 is R1's
primary key and B1 is a foreign key to the relation
* * * * R2(K2, A2)
where K2 is R2's primary key and A2 is the set of its remaining attributes..

Then the foreign key B1 represents the functional dependency
* * * * B1 --> A2,
which is the functional dependency across two relation I mentioned in
the first sentence.

Furthermore, through transitivity by the functional dependency K1 --
B1, the foreign key also represents the inter-relational functional
dependency
* * * * K1 --> A2.

Am I correct to say this?
Not really. Your observation that sometimes the inference rules are
the same for functional and inclusion dependencies is correct, but
unfortunately this is not true in general. For example, the
augmentation rule does not always hold for inclusion dependencies. In
fact, axiomatizing the combination of functional and inclusion
dependencies is a notoriously difficult problem and in the past there
has been intensive research on that subject.

-- Jan Hidders


Quote:
--

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