[AccessD] Aquarium Life

John W. Colby jwcolby at gmail.com
Tue Mar 3 21:41:40 CST 2015


Anyone out there doing freshwater aquariums?  And yes this will lead 
into databases.

I found a site which labels the fish on a bunch of scales
Difficulty
Temperament
Temp Hi
Temp Lo
Hardness Hi
Hardness Lo
PH Hi
PH Lo
Max Size

So... it turns out that selecting a mix of fish to coexist in a tank is 
not straightforward.  I have pulled 34 fish into a table with these 
columns all filled out.  So now I need to build a method that will allow 
me to select fish.  As I select new fish, it has to track back and make 
sure that the new selection meets all of the requirements of the 
previous selection(s).  See the table below.

So if the first fish selected is a cory cat, (12,13,or 14), the second 
fish selected must be able to live in the water temperature, hardness 
and PH that the Cory Cat can live in.

Simple eh?

Algorithmically, take the outside ranges, and keep the innermost value 
of each end as a new fish is selected.  Take temp for example

*Fish* ID 	FI_TankSize 	FI_Difficulty 	FI_Temperament 	FI_TempLow 
FI_TempHi 	FI_HardnessLo 	FI_HardnessHi 	FI_PHLo 	FI_PHHi 	FI_MaxSize 
FI_Price 	FI_Name 	FI_URL
12 	30 	Easy 	Peaceful 	72 	79 	2 	12 	5.8 	7 	2 	5.99 	Albino Aeneus 
Cory Cat 
_http://www.liveaquaria.com/product/prod_display.cfm?c=747+870+953&pcatid=953_ 



ID 	FI_TankSize 	FI_Difficulty 	FI_Temperament 	FI_TempLow 	FI_TempHi 
FI_HardnessLo 	FI_HardnessHi 	FI_PHLo 	FI_PHHi 	FI_MaxSize 	FI_Price 
FI_Name 	FI_URL
17 	30 	Easy 	Peaceful 	74 	79 	4 	10 	6 	7 	2 	1.89 	Cherry Barb 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1008&pcatid=1008_ 


Fish
Given these two fish, the temp range is now 74-79, Hardness is 4-10, PH 
is 6-7

ID 	FI_TankSize 	FI_Difficulty 	FI_Temperament 	FI_TempLow 	FI_TempHi 
FI_HardnessLo 	FI_HardnessHi 	FI_PHLo 	FI_PHHi 	FI_MaxSize 	FI_Price 
FI_Name 	FI_URL
18 	10 	Easy 	Peaceful 	73 	77 	8 	12 	6.5 	7 	2 	2.59 	Turquoise 
Danio 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+948&pcatid=948_ 


Fish
If we add the Danio, the Temp is now 74-77, Hardness is 8-10, and PH is 
6.5-7

So is this possible just using SQL?  Select a PK to add to a "Potential 
selection" table and have SQL return new Min/Max values as I have done 
above manually?  Or should I just do it the grunt (code) way?

The objective is to build a "aquarium calculator" which returns the 
characteristics required to keep the selected fish alive, as well as 
discover as fish are added, whether they are compatible to the existing 
selection.
*Fish* ID 	FI_TankSize 	FI_Difficulty 	FI_Temperament 	FI_TempLow 
FI_TempHi 	FI_HardnessLo 	FI_HardnessHi 	FI_PHLo 	FI_PHHi 	FI_MaxSize 
FI_Price 	FI_Name 	FI_URL
2 	20 	Easy 	Peaceful 	68 	85 	3 	10 	6.5 	8 	3.5 	12.99 	Singapore 
Flower Shrimp 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+1842&pcatid=1842_ 

3 	10 	Easy 	Peaceful 	68 	85 	3 	10 	6.5 	8 	2 	1.99 	Grass Shrimp 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+3347&pcatid=3347_ 

4 	10 	Easy 	Peaceful 	68 	85 	3 	10 	6.5 	8 	2 	1.59 	Ghost Shrimp 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+1468&pcatid=1468_ 

5 	10 	Easy 	Peaceful 	65 	85 	5 	12 	6.5 	8 	1 	3.99 	Nerita Snails 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+1076&pcatid=1076_ 

6 	10 	Easy 	Peaceful 	68 	85 	5 	12 	6.5 	8 	2 	3.99 	Japanese Trapdoor 
Snail 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+1077&pcatid=1077_ 

7 	10 	Easy 	Peaceful 	60 	80 	3 	10 	6 	7.6 	2 	3.99 	Japonica Amano 
Shrimp 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+1843&pcatid=1843_ 

8 	10 	Moderate 	Peaceful 	72 	82 	5 	8 	6.8 	7.8 	2.5 	1.49 	Dwarf 
African Frog 
_http://www.liveaquaria.com/product/prod_display.cfm?c=1075+2945&pcatid=2945_ 

9 	10 	Easy 	Peaceful 	68 	74 	4 	8 	5 	7 	2 	1.89 	Neon Tetra 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1097&pcatid=1097_ 

10 	1 	Easy 	Peaceful 	75 	86 	0 	25 	6 	8 	3 	2.99 	Beta Female 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+832+1014&pcatid=1014_ 

11 	1 	Easy 	Peaceful 	75 	86 	0 	25 	6 	8 	3 	4.49 	Beta Male 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+844&pcatid=844_ 

12 	30 	Easy 	Peaceful 	72 	79 	2 	12 	5.8 	7 	2 	5.99 	Albino Aeneus 
Cory Cat 
_http://www.liveaquaria.com/product/prod_display.cfm?c=747+870+953&pcatid=953_ 

13 	30 	Easy 	Peaceful 	72 	79 	2 	12 	5.8 	7 	2 	5.99 	False Julii Cory 
Cat 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+1161+1176&pcatid=1176_ 

14 	30 	Easy 	Peaceful 	70 	77 	0 	15 	6.2 	7.8 	3 	9.99 	Sterba's 
Cory 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+1161+846&pcatid=846_ 

15 	10 	Easy 	Peaceful 	72 	77 	6 	10 	6 	6.5 	2 	1.99 	Harlequin 
Rasbora 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1065&pcatid=1065_ 

16 	10 	Easy 	Peaceful 	72 	77 	4 	8 	6 	6.5 	2 	4.39 	Bleeding Heart 
Tetra 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+890+906&pcatid=906_ 

17 	30 	Easy 	Peaceful 	74 	79 	4 	10 	6 	7 	2 	1.89 	Cherry Barb 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1008&pcatid=1008_ 

18 	10 	Easy 	Peaceful 	73 	77 	8 	12 	6.5 	7 	2 	2.59 	Turquoise 
Danio 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+948&pcatid=948_ 

19 	20 	Easy 	Peaceful 	64 	72 	8 	12 	5.8 	6.5 	3 	10.99 	Praecox 
Rainbow 
_http://www.liveaquaria.com/product/prod_display.cfm?c=747+870+1059&pcatid=1059_ 

20 	10 	Easy 	Peaceful 	64 	75 	8 	12 	6.5 	7 	3 	1.19 	Zebra Danio 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+881+941&pcatid=941_ 

21 	20 	Easy 	Peaceful 	72 	77 	12 	20 	7 	7.5 	3 	11.49 	Celebes 
Rainbow 
_http://www.liveaquaria.com/product/prod_display.cfm?c=747+870+1024&pcatid=1024_ 

22 	10 	Easy 	Peaceful 	64 	72 	10 	15 	6.5 	7.5 	2 	3.99 	Golden White 
Cloud 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+952&pcatid=952_ 

23 	30 	Easy 	Peaceful 	72 	77 	9 	19 	7 	8 	3 	14.99 	Boesemani 
Rainbow 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1053&pcatid=1053_ 

24 	30 	Easy 	Peaceful 	75 	86 	5 	18 	6.5 	8 	4 	7.49 	Pearl Gourami 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+966&pcatid=966_ 

25 	10 	Easy 	Peaceful 	64 	72 	10 	15 	6.5 	7.5 	2 	11.49 	Long Fin 
White Cloud Minnow 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+950&pcatid=950_ 

26 	20 	Easy 	Peaceful 	64 	82 	10 	30 	5.5 	8 	1 	5.99 	Endler’s 
Livebearer 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1584&pcatid=1584_ 

27 	20 	Easy 	Peaceful 	64 	82 	10 	30 	5.5 	8 	2 	5.99 	Green Cobra 
Guppy 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1048&pcatid=1048_ 

28 	20 	Easy 	Peaceful 	64 	82 	10 	30 	5.5 	8 	2.5 	5.99 	Neon Blue Tux 
Guppy 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+1100+1047&pcatid=1047_ 

29 	20 	Easy 	Peaceful 	64 	82 	10 	30 	5.5 	8 	2 	5.99 	Red Fire 
Guppy 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+1100+1045&pcatid=1045_ 

30 	20 	Easy 	Peaceful 	64 	82 	10 	30 	5.5 	8 	2.5 	5.99 	Lemon Cobra 
Guppy 
_http://www.liveaquaria.com/product/prod_display.cfm?c=747+870+1049&pcatid=1049_ 

31 	20 	Easy 	Peaceful 	64 	82 	12 	30 	7 	8.3 	4 	4.19 	Swordtail 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+2855+1098&pcatid=1098_ 

32 	10 	Easy 	Peaceful 	75 	82 	4 	8 	6 	7.5 	2 	2.59 	Diamond Tetra 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+890+897&pcatid=897_ 

33 	20 	Easy 	Peaceful 	65 	75 	4 	20 	6.5 	7.5 	3 	1.59 	Mosquito 
Fish 
_http://www.liveaquaria.com/product/prod_display.cfm?c=900+1499+1530&pcatid=1530_ 

34 	30 	Moderate 	Peaceful 	75 	81 	4 	8 	6 	6.2 	3 	9.99 	Congo Tetra 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+890+905&pcatid=905_ 

35 	10 	Moderate 	Peaceful 	72 	82 	4 	10 	6 	7.5 	2 	5.49 	Dwarf 
Gourami 
_http://www.liveaquaria.com/product/prod_display.cfm?c=830+882+974&pcatid=974_ 


Fish

-- 
John W. Colby



More information about the AccessD mailing list