Hi All,

After googling around and checking out the archives I still haven't found
the exact answer to my following question:

First off the goal is to give a family multiple quotes from different
companies for insurance based on several factors: age, length of coverage
and coverage limits. All the different rates for different companies will be
in a rate table that I will have to query to get the correct premium per
person and then group the resulting recordset by company and sum the
premium. So I figure I have to do something like:


for each member in $number_of_family_members

CREATE TABLE IF NOT EXISTS quote_for_family TYPE=HEAP
SELECT * FROM rates WHERE
age >=minimum_age AND
age <=maximum_age AND
limit >=minimum_limit AND
limit <=maximum_limit AND
length_days < maximum_days

next member

SELECT company_name, sum(rate), plan_name FROM quote_for_family GROUP BY
company_name

DROP TABLE quote_for_family

And if all is well I have a list of all the different companies' plans with
a the premium totaled for all family members.


What makes this a little more interesting is that I want to do it from a
Perl script - from want I've seen this looks possible. What I'm wondering
is:

Does this look like the right way to tackle the problem?

Should I use a HEAP table or TEMPORARY table to do this? Its going to be on
a webserver with hopefully some steady traffic so performance is a concern.

Any help is greatly appreciated,

Justin



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to