mysql> mysql> SELECT FLOOR(7 + (RAND() * 5)); +-------------------------+ | FLOOR(7 + (RAND() * 5)) | +-------------------------+ | 7 | +-------------------------+ 1 row in set (0.00 sec) mysql>