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!

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.

commented: it helped +0

(ok, I had to google for mapping dabases first...)
I am working on a diagram of ER dabases, but then followed your advice and started designing tables and connections.
When I have something decent, I'll post so I can get your opinions.
Thnaks very much for your answer, Peter. It helped.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.