Clues on modeling a really simple concept
From: Spike <fauria_at_gmail.com>
Date: Mon, 6 Apr 2009 13:01:19 -0700 (PDT)
Message-ID: <16d72645-6a6b-4fd4-bccf-d5002970f9ff_at_q2g2000vbr.googlegroups.com>
Hi everybody!
Date: Mon, 6 Apr 2009 13:01:19 -0700 (PDT)
Message-ID: <16d72645-6a6b-4fd4-bccf-d5002970f9ff_at_q2g2000vbr.googlegroups.com>
Hi everybody!
I'm trying to model a photo gallery, and i have a doubt on how to implement it.
I have a table for users. I have another table for pictures. And finally, i have a table for galleries (which are sets of pictures).
Both galleries and pictures belongs to a single user, but a single picture can be used on many galleries.
So, i have something like this:
users --> pictures --> pictures_to_galleries --> galleries
My question is: Should i add a relationship between galleries and
users?
I would like to query which galleries a user has, and i don't really
know if it is worth adding a foreign key rather than doing a threelevel
join query each time i want to obtain this data.
Thank you very much!
Received on Mon Apr 06 2009 - 22:01:19 CEST