The 3 Different Relationship Types (1 Viewer)

Danjo

New member
Local time
Today, 02:15
Joined
Dec 7, 2021
Messages
16
Hello Again!

I've been trying to get my head around relationships (In Access!!!) and my brain.... my brain..... she fails me :(

I'm 95% there - i get the dynamics, the what, the why and even the how. I'm trying to visualize the different types and this was the best diagram i could come up with.
Does this look right? Many Thanks (I've added a word document inside a zip with the diagram as an attachment should someone want to edit this. Word Docs not supported apparently...).

1639671909429.png
 

Attachments

  • Relationship Types.zip
    36.9 KB · Views: 226

CJ_London

Super Moderator
Staff member
Local time
Today, 02:15
Joined
Feb 19, 2013
Messages
16,607
that is pretty much it, though the scenario Advisor-Sale 1-1 s a bit misleading - implies an agent can only make one sale. There are very few real life illustrations of 1-1 - most examples provided ultimately fail the 1-1 'test' when other factors get taken into account. There was a recent thread on this subject on this forum.

To use a many to many relationship you need an additional joining table containing mapping of specific employees to specific sales - this can be looked at from either direction to see what sales an employee has or what employees were involved in a specific sale.

Think of all data in the context of entities, a person, an invoice, a customer, a product, etc

Then look at each entity - what do you need to know about a person? their name, their email, their phone number, their job role. Then think 'how many, now or in the future?'. Do they have private and business emails? multiple phone numbers? If so then these become separate entities with a 1 to many relationship with the person. Do you need to track the different roles the person has had? If so this will be a one to many relationship with job roles on the basis that over time different people will occupy the same role
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:15
Joined
Jul 9, 2003
Messages
16,280
Hi Danjo, Welcome to AWF!

You may find my blog on many to many useful:-


Cheers Tony
 

isladogs

MVP / VIP
Local time
Today, 02:15
Joined
Jan 14, 2017
Messages
18,216
@Uncle Gizmo (or anyone else who knows the answer)
Off topic but how do you insert an 'expanded link into a post?
I've tried repeatedly and just get the simple link whether I paste it in or use the link button
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 20:15
Joined
Feb 28, 2001
Messages
27,172
Hello, Danjo. You actually omitted one relationship. You have one-to-many, but there is also a many-to-one. Those two are similar but still different. One way to understand relationships is to imagine the real-world ways in which you would use them, i.e. the "practical" approach.

Let's do Many to Many first. You would use this in, say, an emergency clinic with many people coming in to see whichever doctor is available. I.e. it is not a formal practice with established doctor/patient relationships. It's walk-in only. Each visit would then link a doctor to a patient but over time, many patients would see one doctor and many doctors might see one patient. This visit would then be expressed by a many/many table between doctors and patients. The visit would be embodied in a junction table that points to one doctor and one patient and would include a date and a sequence number that could be used by a separate one-many table to show one visit, many symptoms.

Let's do a One to One next. This is actually very rare because it implies that both tables use the same primary key to represent the same thing. The rules of normalization would tell you to combine those tables. However, there are a FEW cases where 1/1 makes sense. When I was with the U.S. Navy as a contractor, we had a database where we had lots of personnel data, but security (classified) and privacy regulations applied to some parts (primarily medical info) of the data. So we had a general personnel table. Then we had a separate table for the secure data and a separate table for the private data. The tables had different permissions on them but we related the general table to the other tables using 1/1 linkages. You could not access the secure or private data unless you had appropriate permissions and THAT worked because of the separate tables.

Now there is one/many and many/one. You use them both for similar but not identical purposes. Let's do one-many first. Suppose you have a sales store that works by an invoicing system. The invoice becomes the document that will be the customer's receipt. On it you list each item the customer purchased. So in this one/many case, the invoice table is the one-side and the list of things purchased by the customer is is the many-side.

Suppose this store has a service department and an appliance comes in needing repair. Each appliance might be in a different state. So on the appliance ticket, the state might be "Awaiting its turn" or "Awaiting parts" or "In work" or "Awaiting pickup" or "Broke so bad God couldn't fix it." The status-code table would be referred to by each repair ticket pointing to one status. This is the many-one case - many appliances but each has only one status at the time.
 

isladogs

MVP / VIP
Local time
Today, 02:15
Joined
Jan 14, 2017
Messages
18,216
Thanks very much for the replies in posts #6 & #7 and indeed to Tony for doing a video explanation
I've tried different methods repeatedly including putting the link on its own line like this:
News-Events - Isladogs on Access
No joy!
That expands to: URL='https://www.isladogs.co.uk/news-events/4585471091.html']News-Events - Isladogs on Access[/URL
NOTE: I've removed the leading & trailing [ ] so it doesn't helpfully fix the link
It works for me using YouTube videos though I normally click the Media button (unnecessary it seems)

I'm now trying to see if I can do it manually using URL unfurl = true
Below I'm typing in URL unfurl="true"]https://www.isladogs.co.uk/news-events/4585471091.html[/URL plus the [..]...it still doesn't work for me


I'll keep trying...!
Anyway, hopefully the above link may be interesting to some of you

EDIT: After doing the change below I see its also fixed this post!
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 02:15
Joined
Jan 14, 2017
Messages
18,216
AHA! Switch off the BB code toggle and paste in the URL ....

And another test...

Hooray! Thanks again.

P.S. Apologies to the OP for going off-piste!
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:15
Joined
Feb 19, 2002
Messages
43,259
Thanks for that link Colin. Microsoft should be downright ashamed of itself if it ever looks at the chart demo created by Thomas and friends and the Pivot table which is still in the works.

For the past 20 years, I've wanted the Access community to buy the rights to Access from MS because MS doesn't have a clue what a gem they have. Despite the constant neglect and downright silly "improvement" tangents by MS, Access is still alive and well. Who cares about Dataverse, give us a way to use linked tables over the internet without feeling like we're watching paint dry.
 

oleronesoftwares

Passionate Learner
Local time
Yesterday, 18:15
Joined
Sep 22, 2014
Messages
1,159
For the past 20 years, I've wanted the Access community to buy the rights to Access from MS because MS doesn't have a clue what a gem they have. Despite the constant neglect and downright silly "improvement" tangents by MS, Access is still alive and well. Who cares about Dataverse, give us a way to use linked tables over the internet without feeling like we're watching paint dry
They pushed most of the research towards the .Net framework and added more languages to the framework.

Little has been done in improving ms access.

Focus has been in recent years on Enterprise platforms.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:15
Joined
Feb 19, 2002
Messages
43,259
The implementation is the same so it is not usually considered as a separate type. You just look at the relationship from the other direction.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 02:15
Joined
Sep 12, 2006
Messages
15,652
They pushed most of the research towards the .Net framework and added more languages to the framework.

Little has been done in improving ms access.

Focus has been in recent years on Enterprise platforms.

Seriously I think Access was a pretty mature product after A2003, indeed really even after A97.
There is nothing in subsequent versions that is absolutely required.

I quite like the rtf text boxes, and auto resizing and positioning controls but that really doesn't affect data handling, as it's presentation, and in any event you could write your own versions for some of the later changes.
 

GPGeorge

Grover Park George
Local time
Yesterday, 18:15
Joined
Nov 25, 2004
Messages
1,855
Take a look at the demo database in this download on my website. It is designed as Pat says, with two main forms and two subforms, one for each side of the many-to-many relationship. Depending one which direction you want to start from, you can select either the artist (main form) and their recordings (subform), or the Song (main form) and the artists who recorded that song (subform). Obviously the two subforms are both bound to the junction table, but designed slightly differently.
 

GPGeorge

Grover Park George
Local time
Yesterday, 18:15
Joined
Nov 25, 2004
Messages
1,855
Thanks for that link Colin. Microsoft should be downright ashamed of itself if it ever looks at the chart demo created by Thomas and friends and the Pivot table which is still in the works.

For the past 20 years, I've wanted the Access community to buy the rights to Access from MS because MS doesn't have a clue what a gem they have. Despite the constant neglect and downright silly "improvement" tangents by MS, Access is still alive and well. Who cares about Dataverse, give us a way to use linked tables over the internet without feeling like we're watching paint dry.
Oops, I almost posted a snarky comment about Dataverse, but rethought that idea. So let me relate an objective observation instead.

Apparently in Dataverse, Date and Time and Date Only are two different Datatypes.

1642005185772.png
 

oleronesoftwares

Passionate Learner
Local time
Yesterday, 18:15
Joined
Sep 22, 2014
Messages
1,159
Seriously I think Access was a pretty mature product after A2003, indeed really even after A97.
There is nothing in subsequent versions that is absolutely required.
Well i will leave those who are active users of office 365 to comment on this
 

Users who are viewing this thread

Top Bottom