Database for Gardening field filters

Hi All,

I am asked to make a database app for Gardening. All plants will need a column/field for full sun, medium sun and shade. Is it a good idea to make a string field with 5 charaters which can contain ie F or F,M or M,S or F,M,S for seaching and filtering? I use Firebird

My Clarion suggestion - BYTE field with simple bitwise operators. My plant suggestion - consider more than 3 sun options.

Since you area using a “real” database, why wouldn’t you have a child file with suntypes. You can then create a view that joins the suntypes and filter to your heart’s content.

5 Likes

That’s the better way. Gives you all sorts of sub type options and the same concept can be used for other nuances that will inevitably crop up (pun intended)

Thx all, A view it will be:) Soil and other “child” options can be integrated too, as mentioned.

1 Like

I suggest you closely consider how your SunTypes child table will relate to Plants. Difficult for me to imagine 1:M as has been implied.

I think it’s a human categorization thing. Clearly it is really a range. If we were doing pH I would suggest a low and a high rather than put in that it was happy at 5.5, 6.0, 6.5 and 7. But soil types I probably go with human-happy ranges like heavy clay, sandy loam, etc.

Add in the fact that plants often thrive in more than one of these. Same for light levels if there is such a thing as “human happy light.”

I think a matrix would be useful, because a plant might be happy in a low pH at warm temps, and also be happy at a neutral ph at a warm and cold temp.

I’d suggest a couple of tables for the matrix. First (parent) is the planting instruction source, second would be planting instructions for the plant.

Then use something like StrPos( Loc:IsolatedPlantingInstructionWord, Mat:Keywords,True) to scan for pertinent words in the second table, in order to normalise the planting instructions from different sources. Even that would be a difficult, because one planting instruction source (ie seed manufacturer), may have more than one person providing the planting instruction and so variability could be introduced. Fortunately some words are vague which allows some leeway, so warm in one country could mean one temp range, but in another country another temp range, so the source of the planting instructions can be factored in.

One question is just how difficult do you want to make this in order to get close to perfection?

I assume a longtitide and latitude or environment type would also be included, like termperate, continental, if using something like the Köppen climate classification - Wikipedia .

That is the question for the designer. Does Claude or ChatGPT get to decide?

I used to use abbreviations that had a table that would lookup the full description. I don’t do that anymore because while it saves some room, it’s minimal with the data sizes we have now. I would go with about a 20 character field with the full description, then a simple lookup to a small table.

Hi all,

For searching in need columns like
light:
full sun, medium sun and shade
Soil:
sand, loam, clay, stony peat
Moisture:
moist
dry, moderately moist, moist, variable, wet
Hight:
Color:
Evergreen:
Etc.

Maybe i could use a wizard to ask these questions sequentially

This is one of those things that always happens. You get an “easy” project won’t take much time
 the more you think about it and try and actually define what you need to keep and the possibilities the bigger it gets.

Just resign yourself to the fact that you’re going to have 50 odd tables with many relationships. It always happens.

Just think about the plants and the attribute each could have. Then search the net for DB definitions or DB Models for the same thing. They almost certainly exist.

Good luck :slight_smile:

Hi Ray,

I mostly agree, but there are some circumstances where the code is better:

  1. Where the name is likely to change, but the meaning isn’t
  2. Where someone is likely to misspell the full label
  3. Where using a two character code (or similar) is an efficient way of entering the data.

As an example of the first, there is a government program here that has variously been called;
mother baby nutrition supplement
prenatal infant nutrition supplement
prenatal and early childhood nutrition supplement

There are a bunch of reports the people who get only that program have to be excluded from. Using the code nothing else needs to change when the program name changes. If the name were stored other things would have to change.

Jon

For landscape designers, I think you will usually find at least 5 levels. For instance, check websites like Proven Winners (6 levels), Monrovia (5 levels). Because these are on a continuum and would require a change in definition to add or subtract, my habit has always been to use a BYTE or SMALLINT with bitwise operators and Clarion equates instead of a separate tables. The plant to light relationship is clearly M:M, which nicely translates to multiple checkbox controls, while still allowing fast, easy search conditions. Using child tables requires two tables for the M:M and also an attribute for light level in the Light table to go along with the description.
I believe much of the same case can be made for your other plant attributes such as soil, moisture etc.

Or one table for edits, with 50 alias files for lookups. This way all the keywords can be kept in one table, and each alias file could be filtered to limit the options.

This site has a layout of attributes which you might find useful.

Didn’t think full sun could be a light choice in the UK. :slightly_smiling_face:

Well it depends on what sort of light you are after.
This is UV light around the planet at different times of the year and hour.

Yeah, I get that. Had the same thing with our video rental software (remember those days). The ‘Type’ code was 3 characters, and the associated description, price, etc., were in a related record. It was good because you could change the description and price, and not worry about changing all the records for the associated inventory items. Every situation is different.

I recently gave instructions to Rocket.New to create what I thought would be a simple 2 or 3 page Flutter app. It came up with 10 pages that it thought I would need for the app, and it was right! (Great program by the way!)