Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Simple structure:

have a table PAGES - which stores information about specific landing pages working on developing a GROUPing concept for the pages, where we are saying that a page may or may not belong to a group, and it will only belong to a single group.

Would a linking table group_page.group_id,group_page.page_id be the proper way to go? Or pages.group_id ?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

This is rather subjective based on the nature of the data, potential for change, deadlines, longevity of the project, storage space, performance requirements, etc.

However, the determining factor will likely be the probability that you will ever need multiple groupings for pages. If you will, then implement a join table now. If not, putting Group_Id inside the pages table is faster to build, less complex, will perform better, and uses less space.

share|improve this answer
    
Thanks -- yes, if multiple grouping will be a case, then I see that requirement (or future proofing) a huge factor ... –  cgmckeever Jun 1 '12 at 16:09
1  
And you can have a UNIQUE constrait now, on group_page (page_id) to ensure one group per page. Which you can lift when that requirement arrives. –  ypercube Jun 2 '12 at 11:52
    
@ypercube I like that idea as well! –  cgmckeever Jun 8 '12 at 0:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.