I have a DB that contains two tables for now:
- "Users": includes data loaded from a CSV.
- "Accounts": Account opened for a certain user.
Both tables have numeric ID field ("UserID", "AccountID"), as the "Accounts" table also has a field called "UserID" for linking these two tables together.
I wish to connect these two tables to make sure that new records in "Accounts" can be added only if they have a matching inserted UserID that is found in the "Users" table. It sounded to me at first like a connection of one-to-one. However, while there can't be an account with a user that is not in the "Users" table, most of the records in "Users" still don't have an account in the "Accounts" table.
Is there any way to enforce data integrity about this relationship in ACCESS/SQL?