View Single Post
Old 04-18-2008, 01:10 PM   #29 (permalink)
lendarios
weeeeee
 
Join Date: Jun 2005
Location: Miami, Fl.
Posts: 726
Sorry groover. Im having problems understanding the relationships.

An ad object has the following elements, a sinlge company attached to it, multiple keyword and other miscelanous properties.
Im assuming one add only applies to one company, one company can have multiple keywords and a keyword can repeat among several companies. Multiple keywords can be attached to a single ad..

Separate the entities

Table 1
CompanyID
CompanyName

Table2
Ad-Id
Add unique information, No company, no Keyword data on this table)

table 3
Keyword ID
keyword text

TAble 4 ( Mapping Keywords to companys
keywordId
companyID

TAble5 ( Mapping Adds to companies)
company-id
Ad-id

table6 (mapping keywords to adds)
ad-id
keywordid

Tables 4 5 6 are integer tables and place indexes on them.
This way your data is normalized. It does require a bit more of upkeep in the application level, but the end result is your data is nicely structure and any query will be served fast. This way you can query how many adds per company, how may adds per keyword. Basically any combination of add/company/keyword you wish.
__________________
Quote:
Originally Posted by Lusiphur View Post
Best raiding game ? Wow.
lendarios is offline   Reply With Quote

 
Uberguilds Network