Hello,
I need help in fetching information from multiple tables simultaneously, I have a MySQL database (using PHP), it comprises of following tables:
1) Orgs – Storing name, login ID and passwords of financial institutions
2) Sch_Main – Storing names, types, profit calculation mechanism or Deposit Schemes (like Term Deposits and Monthly Profit Schemes, etc.)
3) Sch_Details – Storing Minimum deposit, Maximum Deposit limits, Maturity and Rates of profits per annum
A typical Deposit Schemes is as follows:
TENURE 25000-999999 1000000-4999999 5000000
1 Month 2.00% (p.a.) 2.10% 2.2%
3 Months 2.25% (p.a.) 2.35% 2.5%
6 Months 2.50% (p.a.) 2.85% 2.95%
Now as you can see each financial institution can have more than one schemes and each scheme may have more than 2 slabs effected by duration and investment.
Now how should I manage this information in fetch results from these 3 tables, as I read that MySQL does not fully support Foreign Key.
How to write queries like:
Which scheme is offering the best profit rate on 1 month at investment of $25000 and fetch corresponding information of that schemes like name of organization?
Which scheme is offering the highest profit rate with minimum invest in least time?
I shall greatly appreciate elaborated replies assisted with suggested code, thanks.