#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
bool is_selected(double rate){
	 return rand() <  RAND_MAX * rate -1;
}
int main(){
	ofstream	query("query.sql");
	ifstream 	dict("/tmp/words");
	string		words;
	const int	cnt = 2000;
	const int	total = 39916800;
	double		rate = (double)cnt/(double)total;
	srand(time(NULL));
	for(int i=0 ; i<cnt ; i++){
		while(!is_selected(rate) ){
			dict >> words ;
		}
		query << "SELECT * FROM dict WHERE word = '" << words <<"' ;"<<endl;
	}
}


