[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Database for Software List
Harry McGregor <micros@azstarnet.com> wrote:
>I don't know if this is going to be a "real" database, but if it was,
you
>could do a field for each gradelevel, and make it a yes/no for each
SQL supports relations. So you probably only need a minimum age and a
maximum age. To test for grades 3, 4, and 5 you'd do something like
SELECT * FROM program WHERE program.minimum_age < min_age AND
program.maximum_age > max_age
(I might have forgotten my SQL syntax, but that's the basic deal)
Since it's always an interval, this should work just fine.
Age wouldn't necessarily apply to something like an administrative
program. There's also some other details... do you want recommended and
possible ages? Some programs would have very fuzzy boundaries as to
age, and this could represent that. So, a search form might have:
Age you're looking for: ___ age
Fudge that up a bit? (yes/no) fudgeUp
Fudge it down? (yes/no) fudgeDown
going into some psuedo backend where it does something like:
if (fudgeUp) {
topSyntax="program.maximum_possible_age >= " + age
} else {
topSyntax="program.maximum_recommended_age >= " + age
}
if (fudgeDown) {// do the same thing...
sqlQuery="SELECT * FROM programs where " + topSyntax + " AND "
+ bottomSytax
At least, that's an idea. Another thing is how to represent ages into
adulthood. Children can be represented by ages from birth, but you want
something to say "there's no upper limit".
-- Ian