mysqlmysql-workbenchrelationshipidentifying-relationship

Should this be an identifying relationship or not?


well I've posted this question originally on StackExchange for database adminsitrators: https://dba.stackexchange.com/questions/28356/should-this-be-an-identifying-relationship-or-not

But it seems to lack users I guess. So can anyone help me with this?

Edit: Alright, I chose to have a non-identifying relationship, this way the User can be Patient, SpiProfessional or both. Seems to work better, even though it's more work when writing queries. Thanks for everybody's answers, they all contributed to my understanding of databases.


Solution

  • OK, here is what I think based on your design. The User table and Patient table, it shouldn't be 1 to 1 relationship, as the user may not be a patient, so it should be 1 to 0..1 relationship.

    The same goes with SpiProessional. The user may not be a SpiProfessioanl, so the User table to Spiprofessional, should be 1 to 0..1 relationship.

    I think it's worth to have a look at these two post. 1. Any example of a necessary nullable foreign key? 2. Implementing one-to-zero-or-one relation in SQL Server