need awk script

Dear Friends,
I have a data file in the following format having two columns($1 is wavelength , $2 is Flux) and more then 5000 rows. I want to find the maximum value of flux in between wavelength [6992:7096] and Minimum value of flux in wavelength [7116:7145] then I want to take the ratio of (Minimum flux / Maximum Flux). I have such 500 files different txt file for I want to do the same thing, can some one please help me in writing a script in 'awk' for this

5201.72         0.331481
5205.34536    0.3708718
5208.97072    0.4804472
5212.59608    0.5693406
5216.22144    0.6142665
5219.8468      0.5829251
5223.47216    0.5719343
5227.09752    0.5907428
5230.72288    0.6272078
5234.34824    0.6552781
5237.9736      0.6562593
5241.59896    0.6208391
5245.22432    0.593098
5248.84968    0.5895304
5252.47504    0.6128991
5256.1004      0.5773811
5259.72576    0.4899169
5263.35112    0.4324103
5266.97648    0.4284
..............       ............
..............      .............
...............      ...............
..............       ..............

with regards
Arvind

MINFLUX=$(awk -F" " '$1 >= 7116 && 7145 {print $2}' data_file | sort | head -1)

MAXFLUX=$(awk -F" " '$1 >= 6992 && 7096 {print $2}' data_file | sort | tail -1)

Maybe something like this?

awk '
$1 >= 6992 && $1 <= 7096 && $2 > max {max = $2}
$1 >= 7116 && $1 <= 7145 && !min{min=$2}
$1 >= 7116 && $1 <= 7145 && $2 < min {min = $2}
END{print min / max}
' file