Originally published at Now Is A Long Time Too. You can comment here or there.

I’m poking at a project concept here. It might grow into a massive, world-ruling empire, or it might disappear when I find it too complex. However, it needs a database. Without giving away any specifics, it deals with boxes and objects. There is a single main box, which has some method of distinguishing it from other main boxes - probably an ID number, that being nice and simple. It has a number of compartments within it, which may vary. Some of these compartments can hold more than object, others can only hold one. Some compartments have limits as to what types of objects they can contain. Some objects are containers themselves, and can hold other objects, generally more than one. Some objects are too large to fit in particular containers.

Optional extras for simplicity: Containers cannot hold containers, so the deepest you can go is main-compartment-container-object.  The size limit will only be applied to whether a given object can fit in a given container, not how many other objects are in there.
Can someone who is a little more knowledgable than me in the ways of database design show me how to set up the tables for this?

.
Powered by Dreamwidth Studios

Style Credit

Expand Cut Tags

No cut tags