Question on datatypes for photo app I am working on a relational database design for a photo organising app, and as I have mentioned before, am very new to databases. I need to include exposure, aperture value and focal length. The values I have been provided are:
Exposure: typically represented in seconds, using, e.g. 1/1000 for fast exposure and 20 for very slow;
Aperture: ranging from e.g. 1.1 up to values such as 45;
Focal Length (mm): ranges from about 8 to 1200.
Would you recommend representing these as enums with a range of values, or rather, for example varchar for exposure, text for aperture and int for focal length (I am using MySQL)?
I still am not 100% clear on why you would use which datatypes.
Thanks again for your insight and advice.
you can use double/float for both exposure and aperture because they carry floating points and int/smallint for focal length. you can use varchar for all this but if you need to do any calculation on these that's not good and when you sort you can't get correct out put you wanted because sever treat these values as strings (if use varchar). in my case i always use numeric data types for numbers.