SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    0 Post(s)
    0 Thread(s)

    table structure question

    OK, I've built a stats table to record what pages were looked at in my site.

    I want now, to store the keywords used in a search engine. And I need to know when the keywords were used, so that is why the FK to statistics table, which contains the date.

    so isn't this the correct table structure for the keywords?

    The other option I was considering was to increment a column for frequency rather than storing each keyword in a separate record. But if I do that, I don't think I can store the date when the keyword was used, either using the date of the site visit or in this keywords_used table.

    dat right?

    Code MySQL:
    create table used_keywords
    ( id bigint not null
    , stat_id bigint not null
    , business_id bigint not null 
    , keyword varchar(99) not null
    , constraint keywords_stats_fk
        foreign key (keywords_stat_id)
          references statistcis(id)
    ) engine....

    Last edited by IBazz; Feb 6, 2011 at 19:54. Reason: added question mark so it wasn;t seen as a rhetorical question.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts