Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would suggest the following database/object structure:</p> <pre><code>[Auction] n..1 [Category] 1..n [Variation Attribute] 1..n [Attribute Value] </code></pre> <p>An auction then has a category and several attribute values referring the variation attribute as well:</p> <pre><code>[Auction] = [Category], [Name], [Description] [Auction_AttrVal] = [AuctionID], [VarAttrID], [AttrValID] </code></pre> <p>First of all you can have some kind of category table, which holds items like "Paintings", "Clothes", "Computers". An auction / product is assigned to one category.</p> <p>Each category then defines variation attributes for this specific category. An example would be "Size" for the category "Clothes" or "CPU" for the category "Computers". You can also add predefined values for the variation attributes to limit the number of variations and avoid differentiations like "3GhZ" vs "3 GhZ".</p> <p>This mechanism also allows for easy filtering of search results. You select a category and simply load all variation attributes as filters (or add a flag to an attribute to declare it as such) and offer the values for filtering to the end-user.</p> <p>Furthermore you can make variation attributes for a category mandatory to force users who create the auctions (I'm assuming it's Consumer-to-Consumer) to provide sufficient information for their auction. </p> <p>The code will probably be quite generic and simple. The database structure is highly flexible and extensible. Performance is much better than having all in one table. You probably should create an index (for the field <code>AuctionID</code>) for the <code>Auction_AttrVal</code> table. Please let me know if the database structure is not explained properly.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload