How many related columns should you use on a model. Does it matter?

24 views
Skip to first unread message

Ry

unread,
May 22, 2023, 7:33:38 PM5/22/23
to Django users

How many related columns should you use on a model. Does it matter?

For example, say in a payroll application I have a model Company. Each Company has multiple model Employee. Each Employee has a Job. Does it matter if the final model, Job has a fk to both the Employee and Company model or should the Job only have a relation to the Employee model?  

What is the school of thought on this and why?

Thank you.

Ryan Nowakowski

unread,
May 26, 2023, 12:51:54 PM5/26/23
to Ry, Django users
There are many academic and practical considerations. I'd start here:

https://en.m.wikipedia.org/wiki/Third_normal_form
Reply all
Reply to author
Forward
0 new messages