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?
Database design help
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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.
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.
- speedy33417
- Forum Contributor
- Posts: 128
- Joined: Sun Jul 23, 2006 1:14 pm