A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Key field



 
 
Thread Tools Display Modes
  #1  
Old October 23rd, 2008, 11:22 PM posted to microsoft.public.access
trish
external usenet poster
 
Posts: 237
Default Key field

Hi, I am preparing for an exam and am working through some past exam papers.
There is a questions that says "show how a key field is used in a relational
database across three (3) database tables". I am assuming that the key field
they refer to is the primary key, but how does it go across 3 tables? I hope
someone can shed some light on this for me, in case a similar question comes
up :-) Many thanks.
--
Trish
  #2  
Old October 23rd, 2008, 11:42 PM posted to microsoft.public.access
Pete D.[_3_]
external usenet poster
 
Posts: 488
Default Key field

As nice as I can say it...Read the Homework!!!! Might also read about
relational database using google as the search engine. Many to Many
"Trish" wrote in message
...
Hi, I am preparing for an exam and am working through some past exam
papers.
There is a questions that says "show how a key field is used in a
relational
database across three (3) database tables". I am assuming that the key
field
they refer to is the primary key, but how does it go across 3 tables? I
hope
someone can shed some light on this for me, in case a similar question
comes
up :-) Many thanks.
--
Trish



  #3  
Old October 23rd, 2008, 11:51 PM posted to microsoft.public.access
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Key field

Trish:

Keys can be foreign as well as primary. In a one-to-many relationship the
foreign key in the referencing (many-side) table references the primary key
of the referenced (one-side) table. The referencing table may itself be
referenced by another table, e.g.

Cities references Regions on RegionID; Regions references Countries on
CountryID.

In the above the values of RegionID and CountryID will obviously differ
across three matching rows, but you could have a situation where the value is
the same, e.g.

Sales references SalesPeople on EmployeeID; SalesPeople references Employees
on EmployeeID.

In this example the relationship between SalesPeople and Employees is
one-to-one because SalesPeople is a sub-type of Employees and would only
contain columns specific to sales staff not all employees, with the columns
common to all such as names being in Employees. So the EmployeeID column is
a foreign key of Sales, both a primary key and a foreign key of SalesPeople,
and the primary key of Employees.

Ken Sheridan
Stafford, England

"Trish" wrote:

Hi, I am preparing for an exam and am working through some past exam papers.
There is a questions that says "show how a key field is used in a relational
database across three (3) database tables". I am assuming that the key field
they refer to is the primary key, but how does it go across 3 tables? I hope
someone can shed some light on this for me, in case a similar question comes
up :-) Many thanks.
--
Trish


  #4  
Old October 24th, 2008, 12:44 AM posted to microsoft.public.access
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Key field

Trish,

In addition to Ken's excellent advice, it is also possible (and common)
for a table to be in a one-to-many relationship with two or more other
tables.

--
Steve Schapel, Microsoft Access MVP

Ken Sheridan wrote:
Trish:

Keys can be foreign as well as primary. In a one-to-many relationship the
foreign key in the referencing (many-side) table references the primary key
of the referenced (one-side) table. The referencing table may itself be
referenced by another table, e.g.

Cities references Regions on RegionID; Regions references Countries on
CountryID.

In the above the values of RegionID and CountryID will obviously differ
across three matching rows, but you could have a situation where the value is
the same, e.g.

Sales references SalesPeople on EmployeeID; SalesPeople references Employees
on EmployeeID.

In this example the relationship between SalesPeople and Employees is
one-to-one because SalesPeople is a sub-type of Employees and would only
contain columns specific to sales staff not all employees, with the columns
common to all such as names being in Employees. So the EmployeeID column is
a foreign key of Sales, both a primary key and a foreign key of SalesPeople,
and the primary key of Employees.

  #5  
Old October 24th, 2008, 01:09 AM posted to microsoft.public.access
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Key field

Steve, do you think we should tell her about decomposition into three tables
to achieve Fifth Normal Form?

Only joking, Trish. That really would frighten you. It frightens me!

Ken Sheridan
Stafford, England

"Steve Schapel" wrote:

Trish,

In addition to Ken's excellent advice, it is also possible (and common)
for a table to be in a one-to-many relationship with two or more other
tables.

--
Steve Schapel, Microsoft Access MVP

Ken Sheridan wrote:
Trish:

Keys can be foreign as well as primary. In a one-to-many relationship the
foreign key in the referencing (many-side) table references the primary key
of the referenced (one-side) table. The referencing table may itself be
referenced by another table, e.g.

Cities references Regions on RegionID; Regions references Countries on
CountryID.

In the above the values of RegionID and CountryID will obviously differ
across three matching rows, but you could have a situation where the value is
the same, e.g.

Sales references SalesPeople on EmployeeID; SalesPeople references Employees
on EmployeeID.

In this example the relationship between SalesPeople and Employees is
one-to-one because SalesPeople is a sub-type of Employees and would only
contain columns specific to sales staff not all employees, with the columns
common to all such as names being in Employees. So the EmployeeID column is
a foreign key of Sales, both a primary key and a foreign key of SalesPeople,
and the primary key of Employees.



  #6  
Old October 24th, 2008, 03:47 AM posted to microsoft.public.access
Larry Linson
external usenet poster
 
Posts: 3,112
Default Key field

"Ken Sheridan" wrote

Steve, do you think we should tell her about
decomposition into three tables
to achieve Fifth Normal Form?


Decomposition? Your tables are _rotting_, Ken? That is a frightening
prospect.

For several versions, I know we had The Amazing Biodegradable Forms Feature,
but that was Forms that rotted, not tables... GRIN

Larry



  #7  
Old October 24th, 2008, 06:11 PM posted to microsoft.public.access
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Key field

Sounds nasty I know, but blame Codd and Date, not me. As far as I know its
been the 'technical' term used since before Doris day was a virgin.

Ken Sheridan
Stafford, England

"Larry Linson" wrote:

"Ken Sheridan" wrote

Steve, do you think we should tell her about
decomposition into three tables
to achieve Fifth Normal Form?


Decomposition? Your tables are _rotting_, Ken? That is a frightening
prospect.

For several versions, I know we had The Amazing Biodegradable Forms Feature,
but that was Forms that rotted, not tables... GRIN

Larry





  #8  
Old October 30th, 2008, 02:14 AM posted to microsoft.public.access
trish
external usenet poster
 
Posts: 237
Default Key field

Thanks so much to all concerned for the helpful advice. I learned a lot from
it. As it happened, such a question did not arise in the exam :-) Many
thanks again.
--
Trish


"Trish" wrote:

Hi, I am preparing for an exam and am working through some past exam papers.
There is a questions that says "show how a key field is used in a relational
database across three (3) database tables". I am assuming that the key field
they refer to is the primary key, but how does it go across 3 tables? I hope
someone can shed some light on this for me, in case a similar question comes
up :-) Many thanks.
--
Trish

 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.