Relationship 1 - 1

0

I'm having a bit of trouble drawing my relational database model.

The idea follows the following principle:

  • You would have a login system, and for this a table user
  • There would also be 3 types of people who would log in to the producers, vendors, and customers system.
  • A provider has a relationship with another table named address
  • And a producer relates to another table named BankingData

I've seen all relationships from 1 to 1 but I can not figure out how best to reproduce a relational model for the problem described.

What I've done so far:

I do not know if what I did is right or if the links are correct, I remember some concepts spoken by the teacher about weak, strong cardinalities and the like, and I tried to apply these concepts here, but it might be that I do not dominate them yet.

Can someone explain to me the best way to solve this problem I have been through, and also explain in general why it is so? Thank you all right away!

    
asked by anonymous 16.09.2017 / 01:32

1 answer

0

Dude, I have two things to tell you. The first is that there is no better way to create a relational model. The second is that there is no right and wrong. When it comes to relational modeling, you do have some concepts and techniques that help you build one that was maintainable and elegant, but it does not mean that if you do not follow them, you'll be wrong.

Some points I can observe about your model that you can improve:

  • Your client entity has only one primary key and one foreign key. It does not make much sense for you to have an entity to store any information. Unless it is an associative entity, as is the case of its "producer" entity.
  • When creating an entity, you can think of the following way (it helps me a lot, I do not know if it will help you): Your "user" entity for example. Be aware that since you have put "name" as an attribute of this entity, there will not be a person in your model who is not a user, because you will not be able to name it, since this attribute is a user. So what I would do would be to create a person entity, which relates to the user in a 1 to 1 relationship. This person entity would have the name attribute.
  • Look for good modeling practices, especially for abbreviations, typing, and uppercase / lowercase letters. It avoids redundancy and confusion when returning to the model after a while. Unfortunately I do not have any source to indict you, as I have not read about this for some time, but I believe you still value these standards.
  • Email is an attribute that I'd separate into an entity. Just like you did with Address. The email has an address, a service (gmail, hotmail, etc.), among others.
  • 16.09.2017 / 02:34