Will
Will

Reputation: 58

Using a MS Access SQL query to create a second table with a one-to-one relationship with the existing table

I am using Microsoft Access 2016 and am attempting to use an Access SQL query to create a new table with a one-to-one relationship with an existing table.

I have already set-up the first table of the database - employees.

I have then used another query to create a second table (desks) and to link the EmployeeID field as a foreign key. However, it creates a one-to-many relationship, rather than a one-to-one relationship.

How do I need to alter the queries to create a one-to-one relationship? Thanks for your help!

Upvotes: 2

Views: 243

Answers (1)

EliteRaceElephant
EliteRaceElephant

Reputation: 8162

EmployeeID in table Employess linking to the unique attribute of table Desks guarantees a 1-to-1 relationship even if the relationship diagram says otherwise.

I would claim that the relationship diagram does not consider unique attributes and therefore shows it as a 1-to-many relationship.

Upvotes: 1

Related Questions