2

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!

1
  • 2
    Your second table has a 1-1 relationship, even if your tools do not show it. The unique key connection to a primary key guarantees that. Commented Feb 20, 2017 at 2:45

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I did wonder whether that might be the case, it's strange how access doesn't properly show the relationship, even though the UNIQUE constraint is effectively the same as ticking "indexed" and "unique" in the fields tab on the ribbon in Access and this leads to the relationship diagram updating to show a one-to-one relationship rather than one-to-many.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.