Forum Moderators: open

Message Too Old, No Replies

Simple Database Design Question for Photo Database

photo database design

         

davidfromoz

11:13 pm on Jan 20, 2008 (gmt 0)

10+ Year Member



Hi,

I am rather new to databases and I have made plans to make a small database to manage my photos.

I will have a table for picture which contains the base information for the photo like date taken, date imported.

Now a digital photo can have several formats. For me they will be jpg and nef (a raw photo format with a bit more information). In the future I might make some image setting tables to those files which will be different for the different formats.

There will only ever be 1 raw file for each picture (there might be zero). There might be zero or more jpg files.

So should my database look like:

picture -> file_jpg
-> file_nef

or should it look like

picture -> file_jpg_nef

cheers,

David

physics

4:19 am on Jan 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best way is probably to have the picture field be a number field which would hold the id of the picture in a pictures table, then you have another table for the types. For example:

some_table:
someid, something, pictureid, other_info

picture_table:
pictureid, typeid, picture_name, other_picture_info

type_table:
typeid, type_name, other_type_info

That may or may not be going too far with normalization :)