Hi, I'm designing a relational database, but I'm not too much experienced, so I'd like to ask a suggestion about the relational tables with photos.
I thought to use a table
to store photos
, and one or more tables for user data and subject links, so the photos can be linked to different subjects, for example to houses
, or trees
, in this case I could have this structure
table_houses
- house_id
- house_name
- house_architect_name, house_..., etc.
table_trees
- tree_id
- tree_name
- tree_plant_type, tree_..., etc.
table_photos
- photo_id
- photo_filename
- photo_date
- photo_user_id
table_rel_houses
- rel_id
- rel_house_id
- rel_photo_id
- rel_user_id
- rel_vote_id
- rel_warn_id
table_rel_trees
- rel_id
- rel_tree_id
- rel_photo_id
- rel_user_id
- rel_vote_id
- rel_warn_id
table_warns, table_votes, etc.
in this case, the relational tables should have the same structure, because the work in the same way, but point to a different subject (house or tree type)
could the structure of the data be correct or should I scompose much more the relational table in a table_rel_votes
and table_rel_warns
?
I'll need classical pages with a bigger photo and the thumbnails to navigate others, I must consider that the structure could store many millions of photos rows