RAND() function in sql returns random decimal number. I need interger value that's why i am applying multiply to get integer number. I used LEFT() to get only 6 digit number.
You can increase or decrease number according to your requirements.
To get 4 digit random number, see below example.