All in the one table OR not...
Hi, i am developing a site at the moment and i need to work on the Notification Settings for my members.
I have 'members' table in my database that contains info such as:
- first name
- last name
I have on average 10 different notification and email settings that each user can customise, such as:
[ ] email me when i am sent a new private message
Should i expand the 'members' table and add the 10 notification settings or should i create a separate 'notifications' table that will hold all of the notification settings and link it to the 'members' table with a foreign key, thanks in advance for you help...
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
I would say it depends. if each member only has one row in the members table and they are likely to only have one row in the notifications table then I would just have one table that handles all of it. You aren't expanding your members table be many columns (10) so that wouldn't be a problem. Easier to script and maybe less round trips to the database when calling your values, unless of course you are great with joining multiple sql statements to pull values from different tables at the same time (I still find them a bit of a pain sometimes).
If your notifications table is likely to have multiple rows per member then definitely go for the second option as Charles says. Also if your database is likely to grow with more and more values being added as you go along then again it maybe better to have a separate notifications table.
Just my opinion. Hope I've not complicated things. :-)
Last edited by cannon303; 06-12-2012 at 05:45 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)