0

We are working on separated apps here at office and we trying to make it so users only have to log in once and they can access to each app separatedly if they have access. For this i created this model.

enter image description here

The ideal would be one users table but this is not possible at the moment because both tables have different columns but both have the same ID. I was wondering if this is possible to do, link both tables to the same key on other side

Jackal
  • 3,359
  • 4
  • 33
  • 78
  • 1
    How do we read this diagram? There are many styles. Please give a legend. Better would be DDL. Tell us the table meanings & constraints. What are h & x & the left hand tables? Anyway--Please [use text, not images/links, for text--including tables & ERDs.](https://meta.stackoverflow.com/q/285551/3404097) Use images only for what cannot be expressed as text or to augment text. Images cannot be searched for or cut & pasted. Also it is not clear what the "one users table" design is or what "link both tables to the same key on [the] other side" means. – philipxy Mar 15 '19 at 10:10
  • 1
    PS Tables do not need "links". Tables represent relation(ship)s/association. FKs record where subrows must appeaer elsewhere as CKs, for integrity. FDs affect table choice, FKs fall out of table choice. Just find tables that clearly record your business situations. – philipxy Mar 15 '19 at 10:12
  • So you are telling me i dont really need a connection between Users and UserApps? – Jackal Mar 15 '19 at 10:14
  • 1
    I don't know what your diagram says or what rows in your tables mean. And there's no Users table. So your comment isn't clear. Please edit your question per my first comment. (Please also use English.) PS You have a design involving subtypes/inheritance. (Types of users.) Design options for that is a faq. (Although your particular case might or might not involve a more specific question.) [How can you represent inheritance in a database?](https://stackoverflow.com/q/3579079/3404097) A design anti-pattern is multiple FKs [sic] to multiple tables. – philipxy Mar 15 '19 at 10:35

0 Answers0