I’m developing a database and need to know the best way to store dimensions in a Database. Some objects have Length, width, height & depth. Some have length and width only. How to store these data properly in the database?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You relate the object with the Dimension type if you want it normalized.
So if I had an object that had length and width only
Many side table, the many being the type of
dimensions, the one side being theObject.Here is another example with what you gave Length, Width, height, Depth:
The key here is you have a one side table (the object) pointing to a many side table (the dimensions). Some objects can have a dimension others don’t have any dimension (a point for example). I don’t know your table layout but you could have something to this effect: