Hello
I think to get help you'll need to expand a bit on the details.
What tables are you thinking of setting up (or trying to decide on)? What exactly is the relationship you want to define between each?
Classically you'd have each of your entities set up with their own tables - company, departments, machines, parts etc - then establish the relation between each. e.g.
company has many departments | department belongs to company
department has many machines | machine belongs to department
machine has many parts | part belongs to machine
I'm not sure exactly what you're trying to do but my intuition is that if you set up each table separately, with appropriate relations, you'll be able to work your conditions into your app.