random number table and sql functions