0

First of all, sorry for my english, is not my native language.

Well, I have a problem with my database design, I mean: I have a Java Web Application (using JSP, Servlets, Classes and Mysql RDBMS) and I have been storing data about properties and it's owners mainly (there are others entities but those are the important here). Now, I need to create a new module to store data about events, something like this:

  • Event: name, location, date, topic, etc.
  • Participants: Identification, name,location, type of participant (speaker or assistant)

I've been thinking in my database design and most of the assistants are already stored in the Owner entity, but other don´t.

The problem is:

  1. If I create an assistant entity, I'm going to repeat the same data which is alreade stored in Owner Entity (for those assistants that are already created as owners). So, if later I need to store data about surveyers or sales person or whatever, I'm going to have the same data in different tables.
  2. I was thinking on create a Person Entity, and use it to store the properties that are common between assistants and Owners (even for my user table) but I have read about inheritance in a database and people say it's not a good practice for database design purposes.

How can I solve this problem? What's the best practice in this case?

sschrass
  • 7,014
  • 6
  • 43
  • 62
  • 1
    Modeling inheritance in relational databases is not inherently bad; when it's needed, there are specific techniques to maintain integrity. For example, a person entity plus a relation that keeps track of what roles each person has. Can you provide some more information on what an owner is, and what kinds of people you're trying to store? I assume you are familiar with relational database concepts in general, like foreign keys, referential integrity, and database normalization. – Backgammon Mar 23 '18 at 23:41
  • See [How do you effectively model inheritance in a database?](https://stackoverflow.com/questions/190296/how-do-you-effectively-model-inheritance-in-a-database) and read Jeffrey Whitledge's answer as well. Anyway, I would create a Person table. – reaanb Mar 25 '18 at 05:56
  • Hi @Backgammon Owner entity has basic info about a person (identification, name, lastname, phone, email, etc) and between the property table and owner table there is an entity that stores the relation between a property and an owner. Thats why I I think that if I create an assistant table and later a seller table or surveyer or whatever, I'm going to have the same data in many different tables. – Edwin Santos Mar 28 '18 at 16:21

0 Answers0