Page 1 of 1

Database design help

Posted: Mon Aug 28, 2006 2:19 pm
by speedy33417
I'm working on a photo album and I need help designing my database. It's pretty standard: the pictures are collected in albums, and more albums can be in albums as well. Addition to that users can leave comments for individual pictures.
Obviously pictures could have comments from zero to any number.

What is the easiest way to design my database?

I'm thinking I might assign to each picture a unique number no matter what album they're in and have a separate table for comments. For each comment I'll assign that unique number and list them in order underneath my picture.

Does it sound like a good way to go? Or can you guys recommend a better way?

Posted: Mon Aug 28, 2006 2:33 pm
by RobertGonzalez
Can any photo be in any album?

As for comments, I would make comments in their own table and refer to an image_id, so you can relate comments to their appropriate image.

I might also suggest an album table and an image table, then a join table for the two, depending upon how they relate to one another.

Posted: Tue Sep 05, 2006 1:52 pm
by speedy33417
No, right now any image would only be only in one album.

How do you deal with different level of albums? Let's say in the main album there's an album that contains pictures, but another would contain more albums in them. How do you design your album table?

Thanks.