If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How do I make my db more relational?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-09, 21:43
esku esku is offline
Registered User
 
Join Date: May 2009
Posts: 3
How do I make my db more relational?

Hi,

This is my first post.

I have a website that has lets say 1000 members, and I have a database that holds membership information in the 'users' table. Each user entry has a unique primary key of id (INT). I need to record click-thru information from users/members, so the way I've done it is to create a new table for each user which contains click info, so user 123 will have an associate 'user_123_clicks' table where click-thru info is stored. This just doesn't feel right to me, I can't join tables as it just isn't relational. What I wanted to avoid is have one enormous 'click' table which would have a foreign key of 'user_id', although this would be more relational I guess?

Which in the best way in your opinion to achieve what I need to, without an enormous click table, but without the contrived 'user_123_clicks' tables?

Many thanks for any help/advice...

Steve.
Reply With Quote
  #2 (permalink)  
Old 05-24-09, 22:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
what you really should have is a single table for the clicks

a separate table for each user is a potential disaster

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-24-09, 22:42
esku esku is offline
Registered User
 
Join Date: May 2009
Posts: 3
Quote:
Originally Posted by r937
what you really should have is a single table for the clicks

a separate table for each user is a potential disaster

Many thanks for your reply.

I though large tables were bad too, not as bad as my approach I'm sure, but bad non the less?

Thanks.
Reply With Quote
  #4 (permalink)  
Old 05-25-09, 08:07
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by esku
I though large tables were bad too, not as bad as my approach I'm sure, but bad non the less?
that's not true

of course, large tables that you don't need are bad, but if you need to save all that data, then a large table is often ~way~ better than a bazillion small ones
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 05-27-09, 17:23
esku esku is offline
Registered User
 
Join Date: May 2009
Posts: 3
Thank you for your time and advice.

Looks like a redesign is on the cards....

Cheers, Steve.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On