All we need is an easy explanation of the problem, so here it is.
I am designing an entity relational diagram and I need to categorize entities in groups by their age.
What I have is an entity of
Person and some personal attributes about it. But I want to have information about people based on their age. For example I want to have have groups for people of age 1-10, 11-20, 21-30 and so on.
Is it possible to design something like this in the entity relation diagram, and if yes how, or is it a bad technique and I should implement it in later stages of the development?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
This would be a case for either filtering the data during your query (WHERE clause) or creating a view that already filters it out. In normal practice, a person table is a person table, and unless the fundamental fields are different (like the difference between customers and employees), then all person records go into the same table, and the diagrams reflect that.
When drawing things up, start with just how the data is related across the database, then start worrying about sorting, grouping, and filtering based on the data for when you are planning out stored procedures and views.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂