/* sales.cpp this program is to generate insert statements for sales table @01/30/2004 */ #include //#include #include #include using namespace std; int main() { // Seed the random-number generator with current time so that // the numbers will be different every time we run. //srand((unsigned)time(NULL)); for (int locid=1;locid<186;locid++) { // location: locid for (int pid=1;pid<26;pid++) { // product: pid for (int tid=1;tid<1097;tid++) { // product: tid // insert into sales values(locid,pid,tid,amount); cout << "insert into sales values("<< locid << "," << pid << "," << tid << "," << // this generate random integer between 1 and RANDOM_MAX // RANDOM_MAX is 0x7fff (65535) // use "rand() % range" to adjust the range as needed // rand()<< ");"<