Store attributes/values in XML column - table design

  • Hi experts,

    I'd like to create a table that will store different order items. Several order items make up one single order. Order items can have 0 or more children (max depth will never be deeper than one). Order items can have up to 150 attributes/values. The way I think this should be done is using XML column instead of the EAV type of model. My table structure currently looks like this:

    * child_order_item_id (PK)

    * parent_order_item_id (FK to child_order_item_id)

    * order_id (FK to Order table)

    * product_id (FK to Product table)

    * price

    * attribute_XML

    Any comments would be appreciated as well as any advice on how my attribute_XML should look like or how to validate the xml. Thank you.

  • This was removed by the editor as SPAM

  • Thanks for your response.

    The number of attributes/values will be different for each order item, some may have only 2-3, others may have a hundred. Say I can have at most 100 attributes, does that mean I need to include every single attribute in the schema collection? Also, would it make sense to include price in the XML column, since it is also an attribute of order_item? What about the primary key child_order_item_id?

    <orderitem_attribute>

    <attribute1>asd fgh jkl ...</attribute1>

    <attribute2>$99.95</attribute2>

    <attribute3>1</attribute3>

    <attribute4>Attribute 0000004</attribute4>

    </orderitem_attribute>

    Thank you.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply