SOLVED

Foreign Keys?

Copper Contributor

I am a bit stumped I want to figure out about assigning foreign keys and titling them. Any help to get me pointed in the right direction would be most helpful!

3 Replies

@Bible_Tech 

"...figure out about assigning foreign keys and titling them."

 

That's a broad topic and hardly one that can addressed adequately in a short response.

What, specifically, puzzles you about foreign keys? What is the problem regarding titling, or naming, them? Give us a place to start.

 

 

@George Hepworth Thank you for your response, Mr. Hepworth! I attached a picture that may help what I am trying to accomplish.  I have a couple more if that would help.  I am just setting everything up in excel before I import the data into Access.  May I add you to my "Team" account?

best response confirmed by Bible_Tech (Copper Contributor)
Solution

@Bible_Tech 

No, I can't provide individual consultation via Teams or other methods. I retired a few years ago and no longer take on paid consultations.

 

It's usually easier to provide feedback from actual objects (an Excel worksheet, or preferably an Access accdb) because working from pictures means someone has to create those objects and copy the information from the picture to the actual tables.

 

In this case, I see "Funerals" and "Funeral Homes" in your pictures. I assume that the relationship about which you are concerned is the one that indicates which funeral home is the location for each person's funeral? 

That means you have a one-to-many relationship between each funeral home and the funerals at that location.  The way this would be implemented, therefore, is that the Primary Key for the Funeral Home is recorded in a Foreign Key field in the Funeral table. Is see "ID" indicated, and that would be the primary key. It's usually better to indicate "FuneralID" or "FuneralHomeID" to clarify which one you are talking about. 

Here, then FuneralHomeID is entered as a foreign key in FuneralHomeID in the Funeral table. That relationship needs to have referential integrity enforced on it to ensure that only valid values are entered in the Funeral table for that Foreign Key, and to prevent deleting a Funeral Home Record if that ID has been used for one or more funerals.

1 best response

Accepted Solutions
best response confirmed by Bible_Tech (Copper Contributor)
Solution

@Bible_Tech 

No, I can't provide individual consultation via Teams or other methods. I retired a few years ago and no longer take on paid consultations.

 

It's usually easier to provide feedback from actual objects (an Excel worksheet, or preferably an Access accdb) because working from pictures means someone has to create those objects and copy the information from the picture to the actual tables.

 

In this case, I see "Funerals" and "Funeral Homes" in your pictures. I assume that the relationship about which you are concerned is the one that indicates which funeral home is the location for each person's funeral? 

That means you have a one-to-many relationship between each funeral home and the funerals at that location.  The way this would be implemented, therefore, is that the Primary Key for the Funeral Home is recorded in a Foreign Key field in the Funeral table. Is see "ID" indicated, and that would be the primary key. It's usually better to indicate "FuneralID" or "FuneralHomeID" to clarify which one you are talking about. 

Here, then FuneralHomeID is entered as a foreign key in FuneralHomeID in the Funeral table. That relationship needs to have referential integrity enforced on it to ensure that only valid values are entered in the Funeral table for that Foreign Key, and to prevent deleting a Funeral Home Record if that ID has been used for one or more funerals.

View solution in original post