| | |
database design for photographs
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
Hi
I would like to create a database to classify and control all the photos that I have stored in my computer.
It is clear that I need one table PHOTOS with attributes of ID, name, camera and date.
Second table would be DATA, including aperture, ISO, fstop, focal length, and so.
Then come the problem: I would like to be able to include tags, for example portrait, landscape, etc, but some are subclasses, for example in portrait>family>my kids.
How can I construct the table, simply a list of tags each with an ID? And how do I relate the photo ID to the tags, if there are , say 6 for a photo?
And same problem with the lat table LOCATION in the computer: my files are stored in folders by years and inside the year, dates. I don't know how to construct the table for this.
Can you offer any help? (I am VERY new to databases, but I will learn)
THANK you in advance!
I would like to create a database to classify and control all the photos that I have stored in my computer.
It is clear that I need one table PHOTOS with attributes of ID, name, camera and date.
Second table would be DATA, including aperture, ISO, fstop, focal length, and so.
Then come the problem: I would like to be able to include tags, for example portrait, landscape, etc, but some are subclasses, for example in portrait>family>my kids.
How can I construct the table, simply a list of tags each with an ID? And how do I relate the photo ID to the tags, if there are , say 6 for a photo?
And same problem with the lat table LOCATION in the computer: my files are stored in folders by years and inside the year, dates. I don't know how to construct the table for this.
Can you offer any help? (I am VERY new to databases, but I will learn)
THANK you in advance!
0
#2 Oct 12th, 2009
What you are trying to do is called mapping.
You have table 1 with info on photos and table 2 with info on various photo types. You will create table 3 that will have two entries per record and it will be photoID and photoTypeID.
So once you have request to show all landscape photos you query table 2 of photo types to get ID of landscape type. Then you can query mapping table to get you information on ID of photos associated with this type of photo and with result from this you can pull data from table 1 on selected photos.
You have table 1 with info on photos and table 2 with info on various photo types. You will create table 3 that will have two entries per record and it will be photoID and photoTypeID.
So once you have request to show all landscape photos you query table 2 of photo types to get ID of landscape type. Then you can query mapping table to get you information on ID of photos associated with this type of photo and with result from this you can pull data from table 1 on selected photos.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- your ideas on database design??? (Database Design)
- Database design regarding two 'linking' tables (Database Design)
- Database Design for storing versions (Database Design)
- Database Design feedback (absolute beginner here :) (Database Design)
- Help with contact/mailing list database design... (Database Design)
- Database design - subtypes and instances of an entity (Database Design)
- Database Design - Supertypes and Subtypes (Database Design)
- Database Design Advice (MySQL)
Other Threads in the Database Design Forum
- Previous Thread: 3NF Advice
- Next Thread: database design for a questionaire type form
| Thread Tools | Search this Thread |






