0

USING ORACLE SQL MODELER

I am trying to make Relationship between 2 entities (Roles and Users). The Users table has role_id as a foreign key. The Relationship between Roles(1) and Users(Many) is 1:N, so when I do this on Data Modeler: enter image description here

The relation should be fine. however when I engineer the logical model to relation model, somehow the reverse happens, and Roles table gets user_id foreign key: enter image description here

and when I reverse the relation Roles(Many) and Users(1), only then I get the foreign key role_id in Users table.

Can Somebody help?

4
  • You appear to have your cardinality defined backwards. Source (Users) to Target (Roles) should be one, and Target to Source should be many.
    – pmdba
    Nov 1, 2023 at 20:52
  • @pmdba, I have already mentioned that when I reverse the cardinality, the issue fixes, however the logic of users(1) to Roles(Many) is reversed... Nov 1, 2023 at 21:00
  • You are reading the fields backwards. You say you want Roles to Users as 1:N but your screenshot shows the opposite. It's showing Users:Roles (source-to-target) as 1:N and Roles:Users (target:source) as 1:1. Set the Target Key to Role.ID and reverse the cardinality.
    – pmdba
    Nov 1, 2023 at 22:23
  • Thanks!. @pmdba Nov 3, 2023 at 11:05

0

Your Answer

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